Skip to content

Commit

Permalink
Merge pull request kubernetes#53714 from FengyunPan/fix-SecurityGroup…
Browse files Browse the repository at this point in the history
…Name

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
```
  • Loading branch information
Kubernetes Submit Queue authored Oct 12, 2017
2 parents eabc7a3 + 5af6a0b commit cea1af3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func popMember(members []v2pools.Member, addr string, port int) []v2pools.Member
}

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) {
Expand Down

0 comments on commit cea1af3

Please sign in to comment.