Commit cea1af38 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #53714 from FengyunPan/fix-SecurityGroupName

Automatic merge from submit-queue. 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>. The Securty Group name must be unique Currently the service's name is not unique, and the Securty Group name is not unique too. openstack cloud provider will delete the Securty Group of other loadbalancer service when do a deletion. OpenStack cloud provider get the ID of Securty Group by name, so the Securty Group name must be unique. https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go#L1262 **Release note**: ```release-note NONE ```
parents eabc7a35 5af6a0b4
...@@ -372,7 +372,7 @@ func popMember(members []v2pools.Member, addr string, port int) []v2pools.Member ...@@ -372,7 +372,7 @@ func popMember(members []v2pools.Member, addr string, port int) []v2pools.Member
} }
func getSecurityGroupName(clusterName string, service *v1.Service) string { func getSecurityGroupName(clusterName string, service *v1.Service) string {
return fmt.Sprintf("lb-sg-%s-%v", clusterName, service.Name) return fmt.Sprintf("lb-sg-%s-%s-%s", clusterName, service.Namespace, service.Name)
} }
func getSecurityGroupRules(client *gophercloud.ServiceClient, opts rules.ListOpts) ([]rules.SecGroupRule, error) { func getSecurityGroupRules(client *gophercloud.ServiceClient, opts rules.ListOpts) ([]rules.SecGroupRule, error) {
......
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