Skip to content

Commit a0e4e7b

Browse files
authored
Merge pull request #4174 from k8s-infra-cherrypick-robot/cherry-pick-4158-to-release-1.11
[release-1.11] workaround ASO swallowing updates into ongoing operations
2 parents fe7b9ff + 7f45c80 commit a0e4e7b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

azure/services/aso/aso.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@ func (s *Service) CreateOrUpdateResource(ctx context.Context, spec azure.ASOReso
113113
// update instead of returning early.
114114
adopt = true
115115
case cond.Reason == conditions.ReasonReconciling.Name:
116-
readyErr = azure.NewOperationNotDoneError(&infrav1.Future{
116+
// Updating the spec of an ASO resource that is already being updated will swallow this update
117+
// and ignore it until the next periodic ASO resync.
118+
// ref: https://github.com/Azure/azure-service-operator/issues/3451
119+
err := azure.NewOperationNotDoneError(&infrav1.Future{
117120
Type: createOrUpdateFutureType,
118121
ResourceGroup: existing.GetNamespace(),
119122
Name: existing.GetName(),
120123
})
124+
return nil, azure.WithTransientError(err, requeueInterval)
121125
default:
122126
readyErr = fmt.Errorf("resource is not Ready: %s", conds[i].Message)
123127
}

azure/services/aso/aso_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ func TestCreateOrUpdateResource(t *testing.T) {
231231
Namespace: "namespace",
232232
},
233233
})
234-
specMock.EXPECT().Parameters(gomockinternal.AContext(), gomock.Not(gomock.Nil())).DoAndReturn(func(_ context.Context, group *asoresourcesv1.ResourceGroup) (*asoresourcesv1.ResourceGroup, error) {
235-
return group, nil
236-
})
237-
specMock.EXPECT().WasManaged(gomock.Any()).Return(false)
238234

239235
ctx := context.Background()
240236
g.Expect(c.Create(ctx, &asoresourcesv1.ResourceGroup{

0 commit comments

Comments
 (0)