Skip to content

Commit

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

Automated cherry pick of kubernetes#102083: fix: delete non existing disk issue
  • Loading branch information
k8s-ci-robot authored Aug 10, 2021
2 parents f852c52 + cd34e81 commit 037f67e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package azure
import (
"context"
"fmt"
"net/http"
"path"
"strconv"
"strings"
Expand Down Expand Up @@ -236,6 +237,10 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error {

rerr = c.common.cloud.DisksClient.Delete(ctx, resourceGroup, diskName)
if rerr != nil {
if rerr.HTTPStatusCode == http.StatusNotFound {
klog.V(2).Infof("azureDisk - disk(%s) is already deleted", diskURI)
return nil
}
return rerr.Error()
}
// We don't need poll here, k8s will immediately stop referencing the disk
Expand Down

0 comments on commit 037f67e

Please sign in to comment.