diff --git a/api/v1alpha2/mondooauditconfig_types.go b/api/v1alpha2/mondooauditconfig_types.go index b0b80ce5..cc985d5d 100644 --- a/api/v1alpha2/mondooauditconfig_types.go +++ b/api/v1alpha2/mondooauditconfig_types.go @@ -110,7 +110,7 @@ type Nodes struct { // +kubebuilder:default=60 IntervalTimer int `json:"intervalTimer,omitempty"` // Style specifies how node scanning is deployed. The default is "cronjob" which will create a CronJob for the node scanning. - // +kubebuilder:validation:Enum=cronjob;deployment + // +kubebuilder:validation:Enum=cronjob;deployment;daemonset // +kubebuilder:default=cronjob Style NodeScanStyle `json:"style,omitempty"` // PriorityClassName specifies the name of the PriorityClass for the node scanning workloads. diff --git a/config/crd/bases/k8s.mondoo.com_mondooauditconfigs.yaml b/config/crd/bases/k8s.mondoo.com_mondooauditconfigs.yaml index 4ab1e99f..11144aee 100644 --- a/config/crd/bases/k8s.mondoo.com_mondooauditconfigs.yaml +++ b/config/crd/bases/k8s.mondoo.com_mondooauditconfigs.yaml @@ -538,6 +538,7 @@ spec: enum: - cronjob - deployment + - daemonset type: string type: object scanner: diff --git a/tests/integration/audit_config_test.go b/tests/integration/audit_config_test.go index 7b832e1b..836c7d8e 100644 --- a/tests/integration/audit_config_test.go +++ b/tests/integration/audit_config_test.go @@ -48,7 +48,7 @@ func (s *AuditConfigSuite) TestReconcile_Nodes_CronJobs() { func (s *AuditConfigSuite) TestReconcile_Nodes_DaemonSet() { auditConfig := utils.DefaultAuditConfigMinimal(s.testCluster.Settings.Namespace, false, false, true, false) - auditConfig.Spec.Nodes.Style = v1alpha2.NodeScanStyle_Deployment // TODO: Change to DaemonSet (no effect on reconsile logic) + auditConfig.Spec.Nodes.Style = v1alpha2.NodeScanStyle_DaemonSet auditConfig.Spec.Nodes.IntervalTimer = 1 s.testMondooAuditConfigNodesDaemonSets(auditConfig) }