From 8be82b008ceca4da3d3798d9ec6903dc787f126f Mon Sep 17 00:00:00 2001 From: googs1025 Date: Tue, 28 May 2024 20:50:55 +0800 Subject: [PATCH] use cmd context instead of using context.Background() --- cmd/descheduler/app/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/descheduler/app/server.go b/cmd/descheduler/app/server.go index 3056a25fa3..e7ef713460 100644 --- a/cmd/descheduler/app/server.go +++ b/cmd/descheduler/app/server.go @@ -77,7 +77,7 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command { secureServing.DisableHTTP2 = !s.EnableHTTP2 - ctx, done := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + ctx, done := signal.NotifyContext(cmd.Context(), syscall.SIGINT, syscall.SIGTERM) pathRecorderMux := mux.NewPathRecorderMux("descheduler") if !s.DisableMetrics {