Skip to content

Commit

Permalink
ignore if env vars are empty (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulait authored Jan 9, 2025
1 parent 1b2351c commit 8c81c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloud/linode/cilium_loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func (l *loadbalancers) getCiliumLBIPPool(ctx context.Context, service *v1.Servi

// NOTE: Cilium CRDs must be installed for this to work
func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error {
if raw, ok := os.LookupEnv("BGP_CUSTOM_ID_MAP"); ok {
if raw, ok := os.LookupEnv("BGP_CUSTOM_ID_MAP"); ok && raw != "" {
klog.Info("BGP_CUSTOM_ID_MAP env variable specified, using it instead of the default region map")
if err := json.Unmarshal([]byte(raw), &regionIDMap); err != nil {
return err
Expand Down Expand Up @@ -551,7 +551,7 @@ func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error
},
}
bgpPeerPrefix := defaultBGPPeerPrefix
if raw, ok := os.LookupEnv("BGP_PEER_PREFIX"); ok {
if raw, ok := os.LookupEnv("BGP_PEER_PREFIX"); ok && raw != "" {
klog.Info("BGP_PEER_PREFIX env variable specified, using it instead of the default bgpPeer prefix")
bgpPeerPrefix = raw
}
Expand Down

0 comments on commit 8c81c32

Please sign in to comment.