mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 23:29:21 +00:00
Merge pull request #89604 from aramase/fix-lb
azure: fix concurreny issue in lb creation
This commit is contained in:
commit
b4c82622ec
@ -1101,6 +1101,9 @@ func (ss *scaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac
|
|||||||
|
|
||||||
// Update VMs with best effort that have already been added to nodeUpdates.
|
// Update VMs with best effort that have already been added to nodeUpdates.
|
||||||
for meta, update := range nodeUpdates {
|
for meta, update := range nodeUpdates {
|
||||||
|
// create new instance of meta and update for passing to anonymous function
|
||||||
|
meta := meta
|
||||||
|
update := update
|
||||||
hostUpdates = append(hostUpdates, func() error {
|
hostUpdates = append(hostUpdates, func() error {
|
||||||
ctx, cancel := getContextWithCancel()
|
ctx, cancel := getContextWithCancel()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@ -1401,6 +1404,9 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
|
|||||||
|
|
||||||
// Update VMs with best effort that have already been added to nodeUpdates.
|
// Update VMs with best effort that have already been added to nodeUpdates.
|
||||||
for meta, update := range nodeUpdates {
|
for meta, update := range nodeUpdates {
|
||||||
|
// create new instance of meta and update for passing to anonymous function
|
||||||
|
meta := meta
|
||||||
|
update := update
|
||||||
hostUpdates = append(hostUpdates, func() error {
|
hostUpdates = append(hostUpdates, func() error {
|
||||||
ctx, cancel := getContextWithCancel()
|
ctx, cancel := getContextWithCancel()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user