Skip to content

Commit

Permalink
Update delete test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Apr 18, 2022
1 parent 10dc9de commit faaed62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions azure/services/scalesets/scalesets.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ func (s *Service) Delete(ctx context.Context) error {

// ScaleSet has been deleted
s.Scope.DeleteLongRunningOperationState(vmssSpec.Name, serviceName)
// Note: we want to handle UpdateDeleteStatus when VMSSExtensions have an error when scalesets become an async service
s.Scope.UpdateDeleteStatus(infrav1.BootstrapSucceededCondition, serviceName, nil)

return nil
}

Expand All @@ -210,6 +213,9 @@ func (s *Service) Delete(ctx context.Context) error {

// future is either nil, or the result of the future is complete
s.Scope.DeleteLongRunningOperationState(vmssSpec.Name, serviceName)
// Note: we want to handle UpdateDeleteStatus when VMSSExtensions have an error when scalesets become an async service
s.Scope.UpdateDeleteStatus(infrav1.BootstrapSucceededCondition, serviceName, nil)

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion azure/services/scalesets/scalesets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func TestDeleteVMSS(t *testing.T) {
m.Get(gomockinternal.AContext(), "my-existing-rg", "my-existing-vmss").
Return(compute.VirtualMachineScaleSet{}, autorest.NewErrorWithResponse("", "", &http.Response{StatusCode: 404}, "Not found"))
s.DeleteLongRunningOperationState("my-existing-vmss", serviceName)
s.UpdatePutStatus(infrav1.BootstrapSucceededCondition, serviceName, nil)
s.UpdateDeleteStatus(infrav1.BootstrapSucceededCondition, serviceName, nil)
},
},
{
Expand Down

0 comments on commit faaed62

Please sign in to comment.