Unverified Commit 0ff24a29 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65781 from zetaab/emptysection

Automatic merge from submit-queue (batch tested with PRs 65902, 65781). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. if loadbalancer section is not defined in cloudconfig, do not init support **What this PR does / why we need it**: if LoadBalancer section is not defined in cloudconfig, we should not initialize loadbalancer support for openstack cloudprovider. **Which issue(s) this PR fixes**: Fixes #65775 **Special notes for your reviewer**: **Release note**: ```release-note If LoadBalancer is not defined in cloud config, the loadbalancer is not initialized anymore in openstack. All setups must have some setting under that section ```
parents 13f9c26f 955d2c2d
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"net" "net"
"net/http" "net/http"
"os" "os"
"reflect"
"regexp" "regexp"
"strings" "strings"
"time" "time"
...@@ -573,6 +574,11 @@ func (os *OpenStack) HasClusterID() bool { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment