Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bf28a9be
Commit
bf28a9be
authored
Jan 23, 2017
by
Alexander Block
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set NetworkInterfaces and Subnets to nil before updating Azure security groups
parent
5ab741de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
azure_loadbalancer.go
pkg/cloudprovider/providers/azure/azure_loadbalancer.go
+8
-0
No files found.
pkg/cloudprovider/providers/azure/azure_loadbalancer.go
View file @
bf28a9be
...
...
@@ -83,6 +83,10 @@ func (az *Cloud) EnsureLoadBalancer(clusterName string, service *v1.Service, nod
}
if
sgNeedsUpdate
{
glog
.
V
(
3
)
.
Infof
(
"ensure(%s): sg(%s) - updating"
,
serviceName
,
*
sg
.
Name
)
// azure-sdk-for-go introduced contraint validation which breaks the updating here if we don't set these
// to nil. This is a workaround until https://github.com/Azure/go-autorest/issues/112 is fixed
sg
.
SecurityGroupPropertiesFormat
.
NetworkInterfaces
=
nil
sg
.
SecurityGroupPropertiesFormat
.
Subnets
=
nil
_
,
err
:=
az
.
SecurityGroupsClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
*
sg
.
Name
,
sg
,
nil
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -200,6 +204,10 @@ func (az *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Servi
}
if
sgNeedsUpdate
{
glog
.
V
(
3
)
.
Infof
(
"delete(%s): sg(%s) - updating"
,
serviceName
,
az
.
SecurityGroupName
)
// azure-sdk-for-go introduced contraint validation which breaks the updating here if we don't set these
// to nil. This is a workaround until https://github.com/Azure/go-autorest/issues/112 is fixed
sg
.
SecurityGroupPropertiesFormat
.
NetworkInterfaces
=
nil
sg
.
SecurityGroupPropertiesFormat
.
Subnets
=
nil
_
,
err
:=
az
.
SecurityGroupsClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
*
reconciledSg
.
Name
,
reconciledSg
,
nil
)
if
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment