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

remove VM API call dependency in azure disk WaitForAttach #77483

Merged
merged 1 commit into from
May 9, 2019

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented May 6, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR removes the VM API call dep in azure disk WaitForAttach func, originally devicePath is a disk LUN num, and then it could be a real device path due to the volume status update(you could find more details in this PR: #62612), in that condition, return the devicePath immediately, get disk lun num by VM API call is actually not necessary.

Which issue(s) this PR fixes:

Fixes #77462

Special notes for your reviewer:

release-note:

remove VM API call dep in azure disk WaitForAttach

/assign @feiskyer @khenidak
/priority important-soon
/sig azure

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/azure cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 6, 2019
@k8s-ci-robot k8s-ci-robot requested review from msau42 and rootfs May 6, 2019 07:02
@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. labels May 6, 2019
@andyzhangx andyzhangx changed the title [WIP]remove VM API call dep in azure disk WaitForAttach [WIP]remove VM API call dependency in azure disk WaitForAttach May 6, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 6, 2019
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-cross

@andyzhangx andyzhangx changed the title [WIP]remove VM API call dependency in azure disk WaitForAttach remove VM API call dependency in azure disk WaitForAttach May 6, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 6, 2019
@andyzhangx
Copy link
Member Author

This PR works well on both Linux and Windows node.
/test pull-kubernetes-e2e-aks-engine-azure

@andyzhangx
Copy link
Member Author

/hold
wait, let me add a WaitForAttach unit test tomorrow, you could still review this PR

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2019
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

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

@khenidak khenidak left a comment

Choose a reason for hiding this comment

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

one nit and one big question :-)

if we make this call https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/attacher.go#L84 return lun that was selected on VM model then our getDiskLun and WaitForAttach() would be a lot simpler, right?

pkg/volume/azure_dd/azure_common.go Outdated Show resolved Hide resolved
@andyzhangx
Copy link
Member Author

andyzhangx commented May 7, 2019

one nit and one big question :-)

if we make this call https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/attacher.go#L84 return lun that was selected on VM model then our getDiskLun and WaitForAttach() would be a lot simpler, right?

No, the attach disk logic happens in controller manager, anyway it needs VM API call, while this PR fixed the VM API call dependency in WaitForAttach() in kubelet, originally devicePath is a disk LUN num, and then it could be a real device path due to the volume status update(you could find more details in this PR: #62612), in that condition, return the devicePath immediately, get disk lun num by VM API call is actually not necessary.

The return value of

return strconv.Itoa(int(lun)), err
is already LUN num, and WaitForAttach() in kubelet would return the real device path according to provided LUN num

add comment

add unit test for WaitForAttach fnc

add unit test for WaitForAttach Func
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2019
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-cross
/hold cancel
I have fixed comments and added unit test for WaitForAttach func, PTAL

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 7, 2019
@feiskyer
Copy link
Member

feiskyer commented May 8, 2019

/test pull-kubernetes-e2e-aks-engine-azure

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 May 9, 2019
@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

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. 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/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove VM API dependency in azure disk WaitForAttach
4 participants