@@ -57,7 +57,7 @@ func main() {
57
57
var rejectEmptyNodeDisruption bool
58
58
var retryInterval time.Duration
59
59
var rejectOverlappingDisruption bool
60
- var nodeDisruptionTypes string
60
+ var nodeDisruptionTypesRaw string
61
61
flag .StringVar (& metricsAddr , "metrics-bind-address" , ":8080" , "The address the metric endpoint binds to." )
62
62
flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8081" , "The address the probe endpoint binds to." )
63
63
flag .BoolVar (& enableLeaderElection , "leader-elect" , false ,
@@ -66,7 +66,7 @@ func main() {
66
66
flag .BoolVar (& rejectEmptyNodeDisruption , "reject-empty-node-disruption" , false , "Reject NodeDisruption matching no actual node." )
67
67
flag .DurationVar (& retryInterval , "retry-interval" , controller .DefaultRetryInterval , "How long to wait between each retry (Default 60s)" )
68
68
flag .BoolVar (& rejectOverlappingDisruption , "reject-overlapping-disruption" , false , "Automatically reject any overlapping NodeDisruption (based on node selector), preserving the oldest one" )
69
- flag .StringVar (& nodeDisruptionTypes , "node-disruption-types" , "" , "The list of types allowed for a node disruption separated by a comma." )
69
+ flag .StringVar (& nodeDisruptionTypesRaw , "node-disruption-types" , "" , "The list of types allowed for a node disruption separated by a comma." )
70
70
71
71
opts := zap.Options {
72
72
Development : true ,
@@ -100,14 +100,16 @@ func main() {
100
100
os .Exit (1 )
101
101
}
102
102
103
+ nodeDisruptionTypes := strings .FieldsFunc (nodeDisruptionTypesRaw , func (c rune ) bool { return c == ',' })
104
+
103
105
if err = (& controller.NodeDisruptionReconciler {
104
106
Client : mgr .GetClient (),
105
107
Scheme : mgr .GetScheme (),
106
108
Config : controller.NodeDisruptionReconcilerConfig {
107
109
RejectEmptyNodeDisruption : rejectEmptyNodeDisruption ,
108
110
RetryInterval : retryInterval ,
109
111
RejectOverlappingDisruption : rejectOverlappingDisruption ,
110
- NodeDisruptionTypes : strings . Split ( nodeDisruptionTypes , "," ) ,
112
+ NodeDisruptionTypes : nodeDisruptionTypes ,
111
113
},
112
114
}).SetupWithManager (mgr ); err != nil {
113
115
setupLog .Error (err , "unable to create controller" , "controller" , "NodeDisruption" )
0 commit comments