From dd034a0df93017c3176fe369229e0cc60aae49ea Mon Sep 17 00:00:00 2001 From: Huabing Zhao Date: Fri, 5 Apr 2024 19:43:26 +0800 Subject: [PATCH] fix: nil leader election (#3096) Signed-off-by: huabing zhao Co-authored-by: Guy Daich --- api/v1alpha1/envoygateway_helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/v1alpha1/envoygateway_helpers.go b/api/v1alpha1/envoygateway_helpers.go index de8ddc98537..5f36282f5b5 100644 --- a/api/v1alpha1/envoygateway_helpers.go +++ b/api/v1alpha1/envoygateway_helpers.go @@ -46,6 +46,9 @@ func (e *EnvoyGateway) SetEnvoyGatewayDefaults() { LeaderElection: DefaultLeaderElection(), } } + if e.Provider.Kubernetes.LeaderElection == nil { + e.Provider.Kubernetes.LeaderElection = DefaultLeaderElection() + } if e.Gateway == nil { e.Gateway = DefaultGateway() }