Skip to content

Commit

Permalink
Merge pull request #3876 from camilamacedo86/allow-leader-election
Browse files Browse the repository at this point in the history
🐛 fix Invalid leader election ID generated when domain is empty
  • Loading branch information
k8s-ci-robot committed Apr 27, 2024
2 parents cab5b15 + 1ab2a14 commit 7af3a37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ func main() {
WebhookServer: webhookServer,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "{{ hashFNV .Repo }}.{{ .Domain }}",
{{- if not .Domain }}
LeaderElectionID: "{{ hashFNV .Repo }}",
{{- else }}
LeaderElectionID: "{{ hashFNV .Repo }}.{{ .Domain }}",
{{- end }}
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down

0 comments on commit 7af3a37

Please sign in to comment.