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

Ensure nodeSelector logic is consistent for all operators #466

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Pass-through empty nodeSelector to podSpecs
There is no need drop empty nodeSelector maps, omitempty already does this
olliewalsh committed Nov 19, 2024
commit 0fd9df228370efe6f2c4ea49f428989d1454abb4
2 changes: 1 addition & 1 deletion pkg/cinder/cronjob.go
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ func CronJob(
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
cronjob.Spec.JobTemplate.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

2 changes: 1 addition & 1 deletion pkg/cinder/dbsync.go
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ func DbSyncJob(instance *cinderv1beta1.Cinder, labels map[string]string, annotat
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
job.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

2 changes: 1 addition & 1 deletion pkg/cinderapi/statefuleset.go
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ func StatefulSet(
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

2 changes: 1 addition & 1 deletion pkg/cinderbackup/statefulset.go
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ func StatefulSet(
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

2 changes: 1 addition & 1 deletion pkg/cinderscheduler/statefulset.go
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ func StatefulSet(
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

2 changes: 1 addition & 1 deletion pkg/cindervolume/statefulset.go
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ func StatefulSet(
},
}

if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}