@@ -22,6 +22,7 @@ import (
22
22
var (
23
23
monitorName = "k8s-node-label-monitor"
24
24
nodeLocal = false
25
+ logging = true
25
26
cronjob = ""
26
27
log = logf .Log .WithName (monitorName )
27
28
nodeLabels = map [string ]map [string ]string {}
@@ -210,9 +211,10 @@ func enqueueNodeUpdate(nodeName string, queue workqueue.RateLimitingInterface) {
210
211
func main () {
211
212
var endpoint string
212
213
213
- flag .BoolVar (& nodeLocal , "l" , false , "Only track changes to the local node" )
214
- flag .StringVar (& cronjob , "c" , "" , "Manually trigger named CronJob on label changes" )
215
- flag .StringVar (& endpoint , "n" , "" , "Notification endpoint to POST updates to" )
214
+ flag .BoolVar (& nodeLocal , "local" , false , "Only track changes to the local node" )
215
+ flag .BoolVar (& logging , "logging" , true , "Enable/disable logging" )
216
+ flag .StringVar (& cronjob , "cronjob" , "" , "Manually trigger named CronJob on label changes" )
217
+ flag .StringVar (& endpoint , "endpoint" , "" , "Notification endpoint to POST updates to" )
216
218
217
219
flag .Usage = func () {
218
220
fmt .Fprintf (os .Stderr , "Node Label Monitor for Kubernetes\n " )
@@ -274,8 +276,10 @@ func main() {
274
276
controller := NewController (queue , indexer , informer )
275
277
276
278
// Set up the notifiers for this controller
277
- log .Info ("Enabling Logging notifier" )
278
- controller .notifiers = append (controller .notifiers , notifiers.LogNotifier {})
279
+ if logging {
280
+ log .Info ("Enabling Logging notifier" )
281
+ controller .notifiers = append (controller .notifiers , notifiers.LogNotifier {})
282
+ }
279
283
280
284
if len (endpoint ) > 0 {
281
285
notifier , err := notifiers .NewEndpointNotifier (log , endpoint )
0 commit comments