Skip to content

Commit

Permalink
Fix Invalid leader election ID generated when domain is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Apr 27, 2024
1 parent cab5b15 commit 1ab2a14
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 1ab2a14

Please sign in to comment.