From e60e08e060d4eb111872f23e0bdf8623be34f9b6 Mon Sep 17 00:00:00 2001 From: Monokaix Date: Sat, 18 Jan 2025 18:31:02 +0800 Subject: [PATCH] [bugfix]fix leader-elect-resource-namespace flag not take effect Signed-off-by: Monokaix --- cmd/controller-manager/app/options/options.go | 2 +- cmd/controller-manager/app/options/options_test.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/controller-manager/app/options/options.go b/cmd/controller-manager/app/options/options.go index c67043d5cf..b7670653d9 100644 --- a/cmd/controller-manager/app/options/options.go +++ b/cmd/controller-manager/app/options/options.go @@ -110,7 +110,7 @@ func (s *ServerOption) AddFlags(fs *pflag.FlagSet, knownControllers []string) { "File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated "+ "after server cert).") fs.StringVar(&s.KeyFile, "tls-private-key-file", s.KeyFile, "File containing the default x509 private key matching --tls-cert-file.") - fs.StringVar(&s.LockObjectNamespace, "lock-object-namespace", defaultLockObjectNamespace, "Define the namespace of the lock object; it is volcano-system by default.") + fs.StringVar(&s.LockObjectNamespace, "lock-object-namespace", "", "Define the namespace of the lock object; it is volcano-system by default.") fs.MarkDeprecated("lock-object-namespace", "This flag is deprecated and will be removed in a future release. Please use --leader-elect-resource-namespace instead.") fs.Float32Var(&s.KubeClientOptions.QPS, "kube-api-qps", defaultQPS, "QPS to use while talking with kubernetes apiserver") fs.IntVar(&s.KubeClientOptions.Burst, "kube-api-burst", defaultBurst, "Burst to use while talking with kubernetes apiserver") diff --git a/cmd/controller-manager/app/options/options_test.go b/cmd/controller-manager/app/options/options_test.go index b73cb15b71..e8f96f5ec5 100644 --- a/cmd/controller-manager/app/options/options_test.go +++ b/cmd/controller-manager/app/options/options_test.go @@ -100,7 +100,6 @@ func TestAddFlags(t *testing.T) { ResourceNamespace: defaultLockObjectNamespace, ResourceName: "vc-controller-manager", }, - LockObjectNamespace: defaultLockObjectNamespace, WorkerThreadsForPG: 5, WorkerThreadsForQueue: 5, WorkerThreadsForGC: 1,