Skip to content

Commit

Permalink
Merge pull request kubernetes#104898 from andyzhangx/automated-cherry…
Browse files Browse the repository at this point in the history
…-pick-of-#104572-upstream-release-1.21

Automated cherry pick of kubernetes#104572: fix detach disk issue on deleting node
  • Loading branch information
k8s-ci-robot committed Oct 6, 2021
2 parents f1fbf81 + d494060 commit 70867d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,8 @@ func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourc

func isInstanceNotFoundError(err error) bool {
errMsg := strings.ToLower(err.Error())
if strings.Contains(errMsg, strings.ToLower(vmssVMNotActiveErrorMessage)) {
return true
}
return strings.Contains(errMsg, errStatusCode400) && strings.Contains(errMsg, errInvalidParameter) && strings.Contains(errMsg, errTargetInstanceIds)
}
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,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

0 comments on commit 70867d5

Please sign in to comment.