From 981cdc09c7a0b815a9444fb032bb76f292398f6c Mon Sep 17 00:00:00 2001 From: Abirdcfly Date: Tue, 9 Aug 2022 19:19:27 +0800 Subject: [PATCH] fix: log.Fatal will call os.Exit, use log.Println instead (#8492) Signed-off-by: Abirdcfly --- main.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 66b277b..8c99ff6 100644 --- a/main.go +++ b/main.go @@ -3,23 +3,21 @@ package main import ( "context" "fmt" + "log" + "net/url" + "os" + "os/signal" + "sync" + "syscall" "github.com/keptn/keptn/helm-service/controller" "github.com/keptn/keptn/helm-service/pkg/common" "github.com/keptn/keptn/helm-service/pkg/configurationchanger" "github.com/keptn/keptn/helm-service/pkg/helm" - "net/url" - "os/signal" - "sync" - "syscall" - logger "github.com/sirupsen/logrus" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "log" - "os" - "github.com/keptn/go-utils/pkg/common/kubeutils" "github.com/keptn/keptn/helm-service/pkg/namespacemanager" @@ -231,7 +229,7 @@ func getGracefulContext() context.Context { ctx, cancel := context.WithCancel(cloudevents.WithEncodingStructured(context.WithValue(context.Background(), controller.GracefulShutdownKey, wg))) go func() { <-ch - log.Fatal("Container termination triggered, starting graceful shutdown") + log.Println("Container termination triggered, starting graceful shutdown") wg.Wait() cancel() }()