Skip to content

Commit ba7af32

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
planner: take node selector value from common config if possible
A node selector value found in the common config takes priority over that of the operator config or hard coded default. Signed-off-by: John Mulligan <[email protected]>
1 parent 785fc72 commit ba7af32

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/planner/selector.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ var builtinDefaultNodeSelector = map[string]string{
1717
// NodeSelector returns a mapping of k8s label names to values that are
1818
// used to select what nodes resources are scheduled to run on.
1919
func (pl *Planner) NodeSelector() (map[string]string, error) {
20+
// do we have node selector values specified in the smb common config?
21+
if pl.CommonConfig != nil && pl.CommonConfig.Spec.PodSettings != nil {
22+
ps := pl.CommonConfig.Spec.PodSettings
23+
if len(ps.NodeSelector) > 0 {
24+
return ps.NodeSelector, nil
25+
}
26+
}
27+
// get node selector from operator configuration
2028
if pl.GlobalConfig.DefaultNodeSelector == "" {
2129
return builtinDefaultNodeSelector, nil
2230
}

0 commit comments

Comments
 (0)