From fbda18f6ddd02a9ef346b10d3ca81daa335096fa Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Fri, 14 Aug 2026 11:03:38 +0200 Subject: [PATCH] fix: missing leader election namespace when running out-of-cluster (#2079) Signed-off-by: Dario Tranchitella --- cmd/controller/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 6cdc8dc4..f3ec42dc 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -556,9 +556,10 @@ func main() { Port: webhookPort, TLSOpts: webhookTLSOpts, }), - LeaderElection: enableLeaderElection, - LeaderElectionID: "42c733ea.clastix.capsule.io", - HealthProbeBindAddress: ":10080", + LeaderElection: enableLeaderElection, + LeaderElectionID: "42c733ea.clastix.capsule.io", + LeaderElectionNamespace: ns, + HealthProbeBindAddress: ":10080", NewClient: func(config *rest.Config, options client.Options) (client.Client, error) { options.Cache.Unstructured = true