mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
if loadbalancer section is not defined in cloudconfig, do not initialize lb support
use reflect because structs with []string cannot be compared
This commit is contained in:
parent
8d73473ce8
commit
a78fc5926d
@ -27,6 +27,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -573,6 +574,11 @@ func (os *OpenStack) HasClusterID() bool {
|
||||
func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
|
||||
glog.V(4).Info("openstack.LoadBalancer() called")
|
||||
|
||||
if reflect.DeepEqual(os.lbOpts, LoadBalancerOpts{}) {
|
||||
glog.V(4).Info("LoadBalancer section is empty/not defined in cloud-config")
|
||||
return nil, false
|
||||
}
|
||||
|
||||
network, err := os.NewNetworkV2()
|
||||
if err != nil {
|
||||
return nil, false
|
||||
|
Loading…
Reference in New Issue
Block a user