Skip to content

Commit

Permalink
Pass-through empty nodeSelector to podSpecs
Browse files Browse the repository at this point in the history
There is no need drop empty nodeSelector maps, omitempty already does this
  • Loading branch information
olliewalsh authored and openshift-merge-bot[bot] committed Nov 19, 2024
1 parent 9945903 commit e4c1ba6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/placement/dbsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func DbSyncJob(
},
}

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/placement/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func Deployment(
},
corev1.LabelHostname,
)
if instance.Spec.NodeSelector != nil && len(*instance.Spec.NodeSelector) > 0 {
if instance.Spec.NodeSelector != nil {
deployment.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector
}

Expand Down

0 comments on commit e4c1ba6

Please sign in to comment.