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 azure disk issue when vm not exist #95177
fix detach azure disk issue when vm not exist #95177
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubernetes-node-e2e |
@@ -426,3 +435,14 @@ func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourc | |||
SourceResourceID: &sourceResourceID, | |||
}, nil | |||
} | |||
|
|||
func isInstanceNotFoundError(err error) bool { | |||
if strings.Contains(strings.ToLower(err.Error()), errVMSSInstanceNotFound) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we validate on the error code instead? or the "InvalidParameter" aspect of it. I'm not big fan of error message comparisons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other cases when you'd get a 400
- if the resource you're trying to call is valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can only do the error msg matching here. maybe add more matching condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix comments, PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we check on Code="InvalidParameter"
and Target="instanceIds"
instead. My main concern is them changing the error message and breaking us in some way.
Not gonna block on that however - current still works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, PTAL
f4afc7d
to
28f5142
Compare
/test pull-kubernetes-e2e-kind |
fix comments fix comments
28f5142
to
ed82a6e
Compare
/lgtm |
@andyzhangx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Review the full test history for this PR. Silence the bot with an |
…5177-upstream-release-1.19 Automated cherry pick of #95177: fix detach azure disk issue when vm not exist
…5177-upstream-release-1.17 Automated cherry pick of #95177: fix detach azure disk issue when vm not exist
…5177-upstream-release-1.18 Automated cherry pick of #95177: fix detach azure disk issue when vm not exist
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix detach azure disk issue when vm not exist
Which issue(s) this PR fixes:
Fixes #90986
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/kind bug
/assign @feiskyer
/priority important-soon
/sig cloud-provider
/area provider/azure