Skip to content

Commit aa995ad

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
conf: add a new default node selector config variable
This configuration variable can be used by an admin or developer deploying the operator to change the default node selector values. If specified, this configuration variable is expected to contain a JSON map. Signed-off-by: John Mulligan <[email protected]>
1 parent dec3248 commit aa995ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/conf/config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var DefaultOperatorConfig = OperatorConfig{
2424
SmbdPort: 445,
2525
MetricsExporterMode: "disabled",
2626
ImagePullPolicy: "IfNotPresent",
27+
DefaultNodeSelector: "",
2728
}
2829

2930
// OperatorConfig is a type holding general configuration values.
@@ -78,6 +79,10 @@ type OperatorConfig struct {
7879
// ImagePullPolicy is a (string) value which defines the image-download
7980
// strategy of samba containers.
8081
ImagePullPolicy string `mapstructure:"image-pull-policy"`
82+
// DefaultNodeSelector is a string value containing JSON which defines
83+
// a set of key-value pairs that will be used for all default node
84+
// selection. If left blank, internal defaults will be used.
85+
DefaultNodeSelector string `mapstructure:"default-node-selector"`
8186
}
8287

8388
// Validate the OperatorConfig returning an error if the config is not
@@ -128,6 +133,7 @@ func NewSource() *Source {
128133
v.SetDefault("pod-namespace", d.PodNamespace)
129134
v.SetDefault("pod-ip", d.PodIP)
130135
v.SetDefault("image-pull-policy", d.ImagePullPolicy)
136+
v.SetDefault("default-node-selector", d.DefaultNodeSelector)
131137
return &Source{v: v}
132138
}
133139

0 commit comments

Comments
 (0)