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: detach azure disk broken on Azure Stack #94885

Merged
merged 1 commit into from Sep 22, 2020

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Sep 18, 2020

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 list

Which issue(s) this PR fixes:

Fixes #94886

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix: detach azure disk broken on Azure Stack

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

fix: detach azure disk broken on Azure Stack

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

@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/S Denotes a PR that changes 10-29 lines, ignoring generated files. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. area/provider/azure Issues or PRs related to azure provider approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cloudprovider labels Sep 18, 2020
@cblackuk
Copy link

Thanks for looking into it! Much appreciate it!

@andyzhangx
Copy link
Member Author

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.

@cblackuk
Copy link

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:
https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-acs-differences?view=azs-2005#api-version

The following versions are supported with Azure Stack Hub Storage:

Azure Storage services APIs:

2005 update or newer versions:

2019-02-02
2018-11-09
2018-03-28
2017-11-09
2017-07-29
2017-04-17
2016-05-31
2015-12-11
2015-07-08
2015-04-05
Previous versions:

2017-11-09
2017-07-29
2017-04-17
2016-05-31
2015-12-11
2015-07-08
2015-04-05
Azure Storage services management APIs:

1811 update or newer versions:

2017-10-01
2017-06-01
2016-12-01
2016-05-01
2016-01-01
2015-06-15
2015-05-01-preview
Previous versions:

2016-01-01
2015-06-15
2015-05-01-preview

Not sure that helps though ;-(

@andyzhangx
Copy link
Member Author

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:
https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-acs-differences?view=azs-2005#api-version

The following versions are supported with Azure Stack Hub Storage:

Azure Storage services APIs:

2005 update or newer versions:

2019-02-02
2018-11-09
2018-03-28
2017-11-09
2017-07-29
2017-04-17
2016-05-31
2015-12-11
2015-07-08
2015-04-05
Previous versions:

2017-11-09
2017-07-29
2017-04-17
2016-05-31
2015-12-11
2015-07-08
2015-04-05
Azure Storage services management APIs:

1811 update or newer versions:

2017-10-01
2017-06-01
2016-12-01
2016-05-01
2016-01-01
2015-06-15
2015-05-01-preview
Previous versions:

2016-01-01
2015-06-15
2015-05-01-preview

Not sure that helps though ;-(

thanks, I will write down this link and check first when I made storage side change next time.

@andyzhangx
Copy link
Member Author

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

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

@feiskyer feiskyer Sep 18, 2020

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?

Copy link
Member Author

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.

@feiskyer feiskyer added this to In progress in Provider Azure via automation Sep 18, 2020
fix comments

fix build failure
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2020
@k8s-ci-robot
Copy link
Contributor

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

@andyzhangx
Copy link
Member Author

/milestone v1.20

@k8s-ci-robot
Copy link
Contributor

@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:

/milestone v1.20

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.

@feiskyer
Copy link
Member

/milestone v1.20

@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Sep 22, 2020
@k8s-ci-robot k8s-ci-robot merged commit 2cec7c6 into kubernetes:master Sep 22, 2020
Provider Azure automation moved this from In progress to Done Sep 22, 2020
k8s-ci-robot added a commit that referenced this pull request Sep 29, 2020
…4885-upstream-release-1.19

Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
k8s-ci-robot added a commit that referenced this pull request Sep 29, 2020
…4885-upstream-release-1.17

Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
k8s-ci-robot added a commit that referenced this pull request Sep 29, 2020
…4885-upstream-release-1.18

Automated cherry pick of #94885: fix: detach azure disk broken on Azure Stack
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 "Looks good to me", 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

detach azure disk broken on Azure Stack
4 participants