Skip to content

Commit 8c81c32

Browse files
authored
ignore if env vars are empty (#289)
1 parent 1b2351c commit 8c81c32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cloud/linode/cilium_loadbalancers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (l *loadbalancers) getCiliumLBIPPool(ctx context.Context, service *v1.Servi
482482

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

0 commit comments

Comments
 (0)