Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix validation for daemonset node scans #1173

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading