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: delete non existing Azure disk issue #107406

Merged
merged 1 commit into from Jan 15, 2022

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Jan 7, 2022

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?

fix: delete non existing Azure disk issue

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

fix: delete non existing Azure disk issue

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 7, 2022
@andyzhangx
Copy link
Member Author

andyzhangx commented Jan 7, 2022

/kind bug
/assign @feiskyer
/priority important-soon
/sig cloud-provider
/area provider/azure
/triage accepted

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. area/provider/azure Issues or PRs related to azure provider triage/accepted Indicates an issue or PR is ready to be actively worked on. area/cloudprovider and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 7, 2022
@k8s-ci-robot k8s-ci-robot requested review from aramase and feiskyer Jan 7, 2022
@andyzhangx andyzhangx changed the title fix: delete non existing disk issue fix: delete non existing Azure disk issue Jan 7, 2022
@andyzhangx
Copy link
Member Author

andyzhangx commented Jan 7, 2022

/retest

@andyzhangx
Copy link
Member Author

andyzhangx commented Jan 7, 2022

/retest

1 similar comment
@andyzhangx
Copy link
Member Author

andyzhangx commented Jan 7, 2022

/retest

@ialidzhikov
Copy link
Contributor

ialidzhikov commented Jan 7, 2022

/assign @feiskyer @cheftako

Copy link
Member

@feiskyer feiskyer left a comment

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2022
@ialidzhikov
Copy link
Contributor

ialidzhikov commented Jan 10, 2022

ping @cheftako
for approval

@ialidzhikov
Copy link
Contributor

ialidzhikov commented Jan 14, 2022

ping @cheftako @andrewsykim
for approval

Copy link
Member

@andrewsykim andrewsykim left a comment

/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 {
Copy link
Member

@andrewsykim andrewsykim Jan 14, 2022

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?

Copy link
Member

@andrewsykim andrewsykim Jan 14, 2022

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)
Copy link
Member

@andrewsykim andrewsykim Jan 14, 2022

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?

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 14, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2022
@ialidzhikov
Copy link
Contributor

ialidzhikov commented Jan 14, 2022

/test pull-kubernetes-e2e-kind

@k8s-triage-robot
Copy link

k8s-triage-robot commented Jan 15, 2022

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:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 7bde4ba into kubernetes:master Jan 15, 2022
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 15, 2022
k8s-ci-robot added a commit that referenced this pull request Jan 25, 2022
…107406-upstream-release-1.22

Automated cherry pick of #107406: fix: delete non existing disk issue
k8s-ci-robot added a commit that referenced this pull request Jan 25, 2022
…107406-upstream-release-1.23

Automated cherry pick of #107406: fix: delete non existing disk issue
k8s-ci-robot added a commit that referenced this pull request Feb 11, 2022
…107406-upstream-release-1.21

Automated cherry pick of #107406: fix: delete non existing disk issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cloudprovider area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure: PV hangs forever in failed deletion because the underlying disk is not found
7 participants