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

Commit 68b8208

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #51795 from dims/bug-fix-51755
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634) Bug Fix - Adding an allowed address pair wipes port security groups **What this PR does / why we need it**: Fix for cloud routes enabled instances will have their security groups removed when the allowed address pair is added to the instance's port. Upstream bug report is in: gophercloud/gophercloud#509 Upstream bug fix is in: gophercloud/gophercloud#510 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Fixes #51755 **Special notes for your reviewer**: Just an fix in vendored code. minimal changes needed in OpenStack cloud provider **Release note**: ```release-note NONE ```
2 parents 90b91da + 37f92a8 commit 68b8208

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Serv
994994
}
995995

996996
portID := loadbalancer.VipPortID
997-
update_opts := neutronports.UpdateOpts{SecurityGroups: []string{lbSecGroup.ID}}
997+
update_opts := neutronports.UpdateOpts{SecurityGroups: &[]string{lbSecGroup.ID}}
998998
res := neutronports.Update(lbaas.network, portID, update_opts)
999999
if res.Err != nil {
10001000
glog.Errorf("Error occured updating port: %s", portID)

pkg/cloudprovider/providers/openstack/openstack_routes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func updateAllowedAddressPairs(network *gophercloud.ServiceClient, port *neutron
121121
origPairs := port.AllowedAddressPairs // shallow copy
122122

123123
_, err := neutronports.Update(network, port.ID, neutronports.UpdateOpts{
124-
AllowedAddressPairs: newPairs,
124+
AllowedAddressPairs: &newPairs,
125125
}).Extract()
126126
if err != nil {
127127
return nil, err
@@ -130,7 +130,7 @@ func updateAllowedAddressPairs(network *gophercloud.ServiceClient, port *neutron
130130
unwinder := func() {
131131
glog.V(4).Info("Reverting allowed-address-pairs change to port ", port.ID)
132132
_, err := neutronports.Update(network, port.ID, neutronports.UpdateOpts{
133-
AllowedAddressPairs: origPairs,
133+
AllowedAddressPairs: &origPairs,
134134
}).Extract()
135135
if err != nil {
136136
glog.Warning("Unable to reset allowed-address-pairs during error unwind: ", err)

0 commit comments

Comments
 (0)