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:
Jesse Haka 2018-07-03 23:24:24 +03:00
parent 8d73473ce8
commit a78fc5926d

View File

@ -27,6 +27,7 @@ import (
"net/http" "net/http"
"os" "os"
"regexp" "regexp"
"reflect"
"strings" "strings"
"time" "time"
@ -573,6 +574,11 @@ func (os *OpenStack) HasClusterID() bool {
func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) { func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
glog.V(4).Info("openstack.LoadBalancer() called") 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() network, err := os.NewNetworkV2()
if err != nil { if err != nil {
return nil, false return nil, false