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: delete non existing Azure disk issue #107406
Conversation
/kind bug |
/retest |
staging/src/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go
Show resolved
Hide resolved
/retest |
1 similar comment
/retest |
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.
/lgtm
ping @cheftako |
ping @cheftako @andrewsykim |
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.
/approve
Ack that this is a bug fix
@@ -229,6 +229,10 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error { | |||
|
|||
disk, rerr := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName) | |||
if rerr != nil { | |||
if rerr.HTTPStatusCode == http.StatusNotFound { |
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 see on line 245 we already check for http.StatusNotFound when we call Delete, does that already handle this?
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.
Oh I see now, we need to call Get because of the ManagedBy check on line 239.
@@ -229,6 +229,10 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error { | |||
|
|||
disk, rerr := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName) |
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.
Random question, would the call on line 226 fail if the disk didn't exist?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewsykim, andyzhangx, feiskyer 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-e2e-kind |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
…107406-upstream-release-1.22 Automated cherry pick of #107406: fix: delete non existing disk issue
…107406-upstream-release-1.23 Automated cherry pick of #107406: fix: delete non existing disk issue
…107406-upstream-release-1.21 Automated cherry pick of #107406: fix: delete non existing disk issue
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix: delete non existing disk issue
if one disk does not exist, delete disk should return success instead of error
ported from kubernetes-sigs/cloud-provider-azure#623
Which issue(s) this PR fixes:
Fixes #107405
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: