From cd03ed438ee00e4e4a4aed2d3600c6a36594640a Mon Sep 17 00:00:00 2001 From: Jiaxun Song Date: Mon, 4 Mar 2024 07:53:20 +0000 Subject: [PATCH] terminate gcsfuse in sidecar container if native sidecar is used --- cmd/sidecar_mounter/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/sidecar_mounter/main.go b/cmd/sidecar_mounter/main.go index 25c7c326c..86a58d384 100644 --- a/cmd/sidecar_mounter/main.go +++ b/cmd/sidecar_mounter/main.go @@ -109,9 +109,10 @@ func main() { <-c // blocking the process klog.Info("received SIGTERM signal, waiting for all the gcsfuse processes exit...") - // After the Kubernetes native sidecar container feature is adopted, - // we should propagate the SIGTERM signal to gcsfuse processes here. - // cancel() + if isNativeSidecar { + cancel() + } + mounter.WaitGroup.Wait() klog.Info("exiting sidecar mounter...")