Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix detach disk issue on deleting vmss node #774

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/provider/azure_controller_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,5 +678,8 @@ func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourc

func isInstanceNotFoundError(err error) bool {
errMsg := strings.ToLower(err.Error())
if strings.Contains(errMsg, strings.ToLower(consts.VmssVMNotActiveErrorMessage)) {
return true
}
return strings.Contains(errMsg, errStatusCode400) && strings.Contains(errMsg, errInvalidParameter) && strings.Contains(errMsg, errTargetInstanceIds)
}
4 changes: 2 additions & 2 deletions pkg/provider/azure_controller_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,8 @@ func TestIsInstanceNotFoundError(t *testing.T) {
expectedResult: false,
},
{
errMsg: "not an active Virtual Machine scale set vm",
expectedResult: false,
errMsg: "The provided instanceId 857 is not an active Virtual Machine Scale Set VM instanceId.",
expectedResult: true,
},
{
errMsg: `compute.VirtualMachineScaleSetVMsClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The provided instanceId 1181 is not an active Virtual Machine Scale Set VM instanceId." Target="instanceIds"`,
Expand Down