Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 58e1e86

Browse files
author
FengyunPan
committed
Support autoprobing node-security-group for openstack cloud provider
1. Support autoprobing node-security-group 2. Support multiple Security Groups for cluster's nodes 3. Fix recreating Security Group for cluster's nodes This is a part of #50726
1 parent 49eb961 commit 58e1e86

4 files changed

Lines changed: 265 additions & 86 deletions

File tree

pkg/cloudprovider/providers/openstack/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ go_library(
5656
"//vendor/k8s.io/api/core/v1:go_default_library",
5757
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
5858
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
59+
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
5960
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
6061
"//vendor/k8s.io/client-go/util/cert:go_default_library",
6162
"//vendor/k8s.io/utils/exec:go_default_library",

pkg/cloudprovider/providers/openstack/openstack.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type LoadBalancerOpts struct {
8787
MonitorTimeout MyDuration `gcfg:"monitor-timeout"`
8888
MonitorMaxRetries uint `gcfg:"monitor-max-retries"`
8989
ManageSecurityGroups bool `gcfg:"manage-security-groups"`
90-
NodeSecurityGroupID string `gcfg:"node-security-group"`
90+
NodeSecurityGroupIDs []string // Do not specify, get it automatically when enable manage-security-groups. TODO(FengyunPan): move it into cache
9191
}
9292

9393
type BlockStorageOpts struct {
@@ -248,13 +248,6 @@ func checkOpenStackOpts(openstackOpts *OpenStack) error {
248248
}
249249
}
250250

251-
// if enable ManageSecurityGroups, node-security-group should be set.
252-
if lbOpts.ManageSecurityGroups {
253-
if len(lbOpts.NodeSecurityGroupID) == 0 {
254-
return fmt.Errorf("node-security-group not set in cloud provider config")
255-
}
256-
}
257-
258251
if err := checkMetadataSearchOrder(openstackOpts.metadataOpts.SearchOrder); err != nil {
259252
return err
260253
}

0 commit comments

Comments
 (0)