Skip to content

Commit b94fc6c

Browse files
authored
Merge pull request kubernetes#89605 from aramase/automated-cherry-pick-of-#89604-upstream-release-1.18
Automated cherry pick of kubernetes#89604: fix concurreny issue in lb creation
2 parents 974a91d + dd7fb53 commit b94fc6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,9 @@ func (ss *scaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac
11011101

11021102
// Update VMs with best effort that have already been added to nodeUpdates.
11031103
for meta, update := range nodeUpdates {
1104+
// create new instance of meta and update for passing to anonymous function
1105+
meta := meta
1106+
update := update
11041107
hostUpdates = append(hostUpdates, func() error {
11051108
ctx, cancel := getContextWithCancel()
11061109
defer cancel()
@@ -1401,6 +1404,9 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
14011404

14021405
// Update VMs with best effort that have already been added to nodeUpdates.
14031406
for meta, update := range nodeUpdates {
1407+
// create new instance of meta and update for passing to anonymous function
1408+
meta := meta
1409+
update := update
14041410
hostUpdates = append(hostUpdates, func() error {
14051411
ctx, cancel := getContextWithCancel()
14061412
defer cancel()

0 commit comments

Comments
 (0)