mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
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 ```
This commit is contained in:
commit
0ff24a29c0
@ -26,6 +26,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"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