diff --git a/cmd/scality-cosi-driver/cmd.go b/cmd/scality-cosi-driver/cmd.go index 81a10ab..2c92b88 100644 --- a/cmd/scality-cosi-driver/cmd.go +++ b/cmd/scality-cosi-driver/cmd.go @@ -89,8 +89,7 @@ func run(ctx context.Context) error { } err = server.Run(ctx, registry) - shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 5*time.Second) - defer shutdownCancel() + shutdownCtx, _ := context.WithTimeout(context.Background(), 5*time.Second) if shutdownErr := metricsServer.Shutdown(shutdownCtx); shutdownErr != nil { klog.ErrorS(shutdownErr, "Failed to gracefully shutdown metrics server") }