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

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 requested review from msau42 and rootfs 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

@andyzhangx

This comment has been minimized.

Copy link
Member Author

commented May 6, 2019

/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

@andyzhangx

This comment has been minimized.

Copy link
Member Author

commented May 6, 2019

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

@andyzhangx

This comment has been minimized.

Copy link
Member Author

commented May 6, 2019

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

@feiskyer
Copy link
Member

left a comment

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label May 6, 2019

@feiskyer feiskyer added this to In progress in Provider Azure via automation May 6, 2019

@khenidak
Copy link
Contributor

left a comment

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

This comment has been minimized.

Copy link
Member Author

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

remove VM API call dep in azure disk WaitForAttach
add comment

add unit test for WaitForAttach fnc

add unit test for WaitForAttach Func

@andyzhangx andyzhangx force-pushed the andyzhangx:azuredisk-waitforattach branch from 70af63c to 9a8f07d May 7, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 7, 2019

@andyzhangx

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

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

@feiskyer

This comment has been minimized.

Copy link
Member

commented May 8, 2019

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

@feiskyer
Copy link
Member

left a comment

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label May 9, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

[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

@k8s-ci-robot k8s-ci-robot merged commit ed239ce into kubernetes:master May 9, 2019

21 checks passed

cla/linuxfoundation andyzhangx authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-aks-engine-azure Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Job succeeded.
Details
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

Provider Azure automation moved this from In progress to Done May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.