Skip to content

Commit 484127d

Browse files
jichenjck8s-ci-robot
authored andcommitted
LeaderElectionID should be unique (#479)
Running several Cluster API pods (e.g. CAPI + CABPK + an infra provider) in the same namespace results in leader election errors. This PR added the leader election ID. Also, fixed a go mod problem for kustomize
1 parent c6ff3fd commit 484127d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ifndef HAS_YQ
101101
endif
102102
ifndef HAS_KUSTOMIZE
103103
echo "installing kustomize"
104-
go get sigs.k8s.io/kustomize/v3/cmd/kustomize
104+
GO111MODULE=off go get sigs.k8s.io/kustomize/kustomize
105105
endif
106106
ifndef HAS_ENVSUBST
107107
echo "installing envsubst"

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func main() {
135135
Scheme: scheme,
136136
MetricsBindAddress: metricsAddr,
137137
LeaderElection: enableLeaderElection,
138+
LeaderElectionID: "controller-leader-election-capo",
138139
SyncPeriod: &syncPeriod,
139140
Namespace: watchNamespace,
140141
})

0 commit comments

Comments
 (0)