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

Use CSI driver to determine unique name for migrated in-tree plugins #101737

Merged
merged 1 commit into from
May 6, 2021

Conversation

Jiawei0227
Copy link
Contributor

@Jiawei0227 Jiawei0227 commented May 5, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

This is a forked PR from #101423
Credit to @codablock for reporting and sending the fix. This PR tries to add a unit test for it. It turns out that writing an integrated test using Test_ADC_VolumeAttachmentRecovery is non-trivial as the test is using a special plugin called TestPlugin which does not exist in csi migration. To enable it for CSI migration requires more code refactors. The unit test added in this PR tries to capture the main logic exist in the fix to verify the functionality.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixed false-positive uncertain volume attachments, which led to unexpected detachment of CSI migrated volumes

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


/sig storage
/assign @gnufied
/cc @msau42 @codablock

@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. labels May 5, 2021
@k8s-ci-robot
Copy link
Contributor

@Jiawei0227: GitHub didn't allow me to request PR reviews from the following users: codablock.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

What type of PR is this?

/kind bug

What this PR does / why we need it:

This is a forked PR from #101423
Credit to @codablock for reporting and sending the fix. This PR tries to add a unit test for it. It turns out that writing an integrated test using Test_ADC_VolumeAttachmentRecovery is non-trivial as the test is using a special plugin called TestPlugin which does not exist in csi migration. To enable it for CSI migration requires more code refactors. The unit test added in this PR tries to capture the main logic exist in the fix to verify the functionality.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixed false-positive uncertain volume attachments, which led to unexpected detachment of CSI migrated volumes

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


/sig storage
/assign @gnufied
/cc @msau42 @codablock

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.

@k8s-ci-robot k8s-ci-robot added 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. labels May 5, 2021
@k8s-ci-robot k8s-ci-robot requested a review from msau42 May 5, 2021 06:09
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels May 5, 2021
t.Fatalf("Expect to get plugin \"kubernetes.io/gce-pd\", but got: %s", pluginName)
}

// suppose CSI migration is on for test plugin
Copy link
Member

@gnufied gnufied May 5, 2021

Choose a reason for hiding this comment

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

Should we copy the entire implementation from ad-controller in test? How about something like - gnufied@8be54b4#diff-47fb572faf452565e30c9a91b7e72693d2c6e4bcaecd43aaa9ccb5277b036ef3R385 ?

In this way we just verify attachedVolumes inside ASOW. The test should check if volume spec belongs to CSI driver and not intree driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I verified that the call of processVolumeAttachment will not mark the volume as uncertain with this fix, which indicates the fix works.

@gnufied
Copy link
Member

gnufied commented May 6, 2021

/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 6, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied, Jiawei0227

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2021
@Jiawei0227
Copy link
Contributor Author

/retest

@gnufied
Copy link
Member

gnufied commented May 6, 2021

/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, 2021
@gnufied
Copy link
Member

gnufied commented May 6, 2021

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 6, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 6, 2021
@Jiawei0227
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit a5cf298 into kubernetes:master May 6, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone May 6, 2021
k8s-ci-robot added a commit that referenced this pull request May 18, 2021
…101737-upstream-release-1.19

Automated cherry pick of #101737: Use CSI driver to determine unique name for migrated in-tree
k8s-ci-robot added a commit that referenced this pull request May 18, 2021
…101737-upstream-release-1.20

Automated cherry pick of #101737: Use CSI driver to determine unique name for migrated in-tree
k8s-ci-robot added a commit that referenced this pull request May 18, 2021
…101737-upstream-release-1.21

Automated cherry pick of #101737: Use CSI driver to determine unique name for migrated in-tree
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. 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/apps Categorizes an issue or PR as relevant to SIG Apps. 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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants