@@ -22,6 +22,7 @@ import (
2222var (
2323 monitorName = "k8s-node-label-monitor"
2424 nodeLocal = false
25+ logging = true
2526 cronjob = ""
2627 log = logf .Log .WithName (monitorName )
2728 nodeLabels = map [string ]map [string ]string {}
@@ -210,9 +211,10 @@ func enqueueNodeUpdate(nodeName string, queue workqueue.RateLimitingInterface) {
210211func main () {
211212 var endpoint string
212213
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" )
216218
217219 flag .Usage = func () {
218220 fmt .Fprintf (os .Stderr , "Node Label Monitor for Kubernetes\n " )
@@ -274,8 +276,10 @@ func main() {
274276 controller := NewController (queue , indexer , informer )
275277
276278 // 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+ }
279283
280284 if len (endpoint ) > 0 {
281285 notifier , err := notifiers .NewEndpointNotifier (log , endpoint )
0 commit comments