Skip to content

Commit

Permalink
🐛 fix validation for daemonset node scans
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Sep 18, 2024
1 parent 3c263ff commit 35563f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha2/mondooauditconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/k8s.mondoo.com_mondooauditconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ spec:
enum:
- cronjob
- deployment
- daemonset
type: string
type: object
scanner:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/audit_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 35563f3

Please sign in to comment.