From 905857e8d07a7ad393bdba8365a09b5d0b4375f1 Mon Sep 17 00:00:00 2001 From: backguynn Date: Thu, 23 Nov 2023 16:13:47 +0900 Subject: [PATCH] stop flushing loxilb rules when kube-loxilb pod deleted --- cmd/loxilb-agent/agent.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/loxilb-agent/agent.go b/cmd/loxilb-agent/agent.go index b791a90..79ca345 100644 --- a/cmd/loxilb-agent/agent.go +++ b/cmd/loxilb-agent/agent.go @@ -42,7 +42,6 @@ import ( // https://github.com/kubernetes/kubernetes/blob/release-1.17/pkg/controller/apis/config/v1alpha1/defaults.go#L120 const informerDefaultResync = 12 * time.Hour -var closeSig os.Signal var ( capturedSignals = []os.Signal{syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT} notifyCh = make(chan os.Signal, 2) @@ -196,11 +195,6 @@ func run(o *Options) error { <-stopCh - if closeSig == syscall.SIGTERM { - klog.Info("flushing LoxiLB rules") - lbManager.DeleteAllLoadBalancer() - } - klog.Info("Stopping loxilb Agent") return nil } @@ -209,7 +203,7 @@ func RegisterSignalHandlers() <-chan struct{} { stopCh := make(chan struct{}) go func() { - closeSig = <-notifyCh + <-notifyCh close(stopCh) <-notifyCh klog.Warning("Received second signal, will force exit")