From ad50e3e360f120b8e6f390577e3292bbb908ac6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Fouch=C3=A9?= Date: Thu, 29 Jun 2017 16:49:54 +0200 Subject: [PATCH] Change the levels of some logs --- kubernetes.go | 4 ++-- main.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kubernetes.go b/kubernetes.go index caa0bc98..66532e0b 100644 --- a/kubernetes.go +++ b/kubernetes.go @@ -30,8 +30,8 @@ func newKubeClient(apiserver string, kubeconfig string) (kubeClient kubernetes.I if len(config.BearerToken) > 0 { tokenPresent = true } - glog.Infof("service account token present: %v", tokenPresent) - glog.Infof("service host: %s", config.Host) + glog.V(2).Infof("service account token present: %v", tokenPresent) + glog.V(2).Infof("service host: %s", config.Host) if kubeClient, err = kubernetes.NewForConfig(config); err != nil { return nil, err } diff --git a/main.go b/main.go index b189b23a..dd1b97d7 100644 --- a/main.go +++ b/main.go @@ -184,12 +184,14 @@ func main() { case sig := <-sigs: glog.Infof("Recieved signal: %v", sig) if opts.lock { + // Release the lock before termination glog.Infof("Attempting to release lock") if err := lock.Unlock(); err != nil { glog.Errorf("Lock release failed : %s", err) os.Exit(1) } glog.Infof("Lock released") + // Cleanup the lock if no longer in use glog.Infof("Cleaning lock entry") if err := lock.Destroy(); err != nil { if err != consulapi.ErrLockInUse { @@ -198,8 +200,9 @@ func main() { } else { glog.Infof("Cleanup aborted, lock in use") } + } else { + glog.Infof("Cleanup succeeded") } - glog.Infof("Cleanup succeeded") glog.Infof("Exiting") } os.Exit(0)