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 broken on Azure Stack #94885
fix: detach azure disk broken on Azure Stack #94885
Conversation
Thanks for looking into it! Much appreciate it! |
@cblackuk do you have a contact about which storage API is supported on Azure stack? It's better we could loop storage contact to review the code change in advance in the future. |
Sadly I do not have a GitHub account details from anyone from Storage PG for ASH, but the Storage APIs are listed here: The following versions are supported with Azure Stack Hub Storage: Azure Storage services APIs: 2005 update or newer versions: 2019-02-02 2017-11-09 1811 update or newer versions: 2017-10-01 2016-01-01 Not sure that helps though ;-( |
thanks, I will write down this link and check first when I made storage side change next time. |
/test pull-kubernetes-e2e-kind-ipv6 |
@@ -141,7 +141,11 @@ func (as *availabilitySet) DetachDisk(diskName, diskURI string, nodeName types.N | |||
(disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { | |||
// found the disk | |||
klog.V(2).Infof("azureDisk - detach disk: name %q uri %q", diskName, diskURI) | |||
disks[i].ToBeDetached = to.BoolPtr(true) | |||
if as.cloud.Environment.Name == "AZURESTACKCLOUD" { |
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.
use strings.EqualFold
here and below
if as.cloud.Environment.Name == "AZURESTACKCLOUD" { | ||
disks = append(disks[:i], disks[i+1:]...) | ||
} else { | ||
disks[i].ToBeDetached = to.BoolPtr(true) |
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.
also, add a unit test to catch this change?
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 tried, that would require a complicated mock, @Sakuralbj could you help address this in another PR? thanks.
dc9b305
to
9770938
Compare
fix comments fix build failure
9770938
to
134f949
Compare
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
/milestone v1.20 |
@andyzhangx: You must be a member of the kubernetes/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your and have them propose you as an additional delegate for this responsibility. In response to this:
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. |
/milestone v1.20 |
…4885-upstream-release-1.19 Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
…4885-upstream-release-1.17 Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
…4885-upstream-release-1.18 Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix: detach azure disk broken on Azure Stack
toBeDetached
flag is not supported on Azure Stack, should switch to use original way to remove a disk from data disk listWhich issue(s) this PR fixes:
Fixes #94886
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