fix logging calls (#3260)

This commit is contained in:
mikeweiwei 2018-10-27 19:16:34 +08:00 committed by Manuel Alejandro de Brito Fontes
parent 0e2ac454cb
commit 9d227ab62d

View file

@ -94,7 +94,7 @@ func main() {
if err != nil { if err != nil {
// TODO (antoineco): compare with error types from k8s.io/apimachinery/pkg/api/errors // TODO (antoineco): compare with error types from k8s.io/apimachinery/pkg/api/errors
if strings.Contains(err.Error(), "cannot get services in the namespace") { if strings.Contains(err.Error(), "cannot get services in the namespace") {
glog.Fatalf("✖ The cluster seems to be running with a restrictive Authorization mode and the Ingress controller does not have the required permissions to operate normally.") glog.Fatal("✖ The cluster seems to be running with a restrictive Authorization mode and the Ingress controller does not have the required permissions to operate normally.")
} }
glog.Fatalf("No service with name %v found: %v", conf.DefaultService, err) glog.Fatalf("No service with name %v found: %v", conf.DefaultService, err)
} }
@ -160,7 +160,7 @@ func handleSigterm(ngx *controller.NGINXController, exit exiter) {
signalChan := make(chan os.Signal, 1) signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGTERM) signal.Notify(signalChan, syscall.SIGTERM)
<-signalChan <-signalChan
glog.Infof("Received SIGTERM, shutting down") glog.Info("Received SIGTERM, shutting down")
exitCode := 0 exitCode := 0
if err := ngx.Stop(); err != nil { if err := ngx.Stop(); err != nil {
@ -168,7 +168,7 @@ func handleSigterm(ngx *controller.NGINXController, exit exiter) {
exitCode = 1 exitCode = 1
} }
glog.Infof("Handled quit, awaiting Pod deletion") glog.Info("Handled quit, awaiting Pod deletion")
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
glog.Infof("Exiting with %v", exitCode) glog.Infof("Exiting with %v", exitCode)