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 22, 2024
1 parent d658156 commit ad42d8c
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 ad42d8c

Please sign in to comment.