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

Add support for attachment of inline volumes migrated to CSI #154

Merged
merged 2 commits into from
Jun 12, 2019

Conversation

ddebroy
Copy link
Contributor

@ddebroy ddebroy commented Jun 8, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:
This PR adds support in the external-attacher to handle volume attachments associated with inline volumes that do not have a regular PV associated with it.

Which issue(s) this PR fixes:

Special notes for your reviewer:
Related to kubernetes/kubernetes#77703

Does this PR introduce a user-facing change?:

Support attachment of inline volumes migrated to CSI

@k8s-ci-robot
Copy link
Contributor

Welcome @ddebroy!

It looks like this is your first PR to kubernetes-csi/external-attacher 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/external-attacher has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 8, 2019
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 8, 2019
@ddebroy
Copy link
Contributor Author

ddebroy commented Jun 8, 2019

/cc @msau42 @davidz627 @leakingtapan

Signed-off-by: Deep Debroy <ddebroy@docker.com>
@ddebroy ddebroy force-pushed the inline2 branch 2 times, most recently from 375a6e0 to f478a77 Compare June 10, 2019 00:55
@ddebroy ddebroy changed the title [WIP] Add support for attachment of inline volumes migrated to CSI Add support for attachment of inline volumes migrated to CSI Jun 10, 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 Jun 10, 2019
@ddebroy
Copy link
Contributor Author

ddebroy commented Jun 10, 2019

/assign @saad-ali

@ddebroy ddebroy added this to In progress in Migration: Beta Jun 10, 2019
Copy link
Contributor

@davidz627 davidz627 left a comment

Choose a reason for hiding this comment

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

great work on the implementation and testing for this! That's a lot of unit tests 😅
Implementation LGTM

if va.Spec.Source.InlineVolumeSpec.CSI != nil {
csiSource = va.Spec.Source.InlineVolumeSpec.CSI
} else {
return va, nil, fmt.Errorf("inline volume spec contains nil CSI source")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: errors.New for an error without args

@@ -888,12 +1049,12 @@ func TestCSIHandler(t *testing.T) {
{
name: "detach invalid PV reference-> error",
initialObjects: []runtime.Object{pvWithFinalizer(), node()},
addedVA: deleted(vaWithNoPVReference(va(true, fin, ann))),
addedVA: deleted(vaWithNoPVReferenceNorInlineVolumeSpec(va(true, fin, ann))),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're missing a test where both PV and InlineVolumeSpec are set. Hate to make you write another test after already writing this massive amount, thanks for making sure this is all well tested!

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, we should have an unit test to cover this case. Otherwise I can't find anything wrong in this PR.

@jsafrane
Copy link
Contributor

/approve
Good work! Especially thanks for keeping unit test coverage high!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ddebroy, jsafrane

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 Jun 11, 2019
Signed-off-by: Deep Debroy <ddebroy@docker.com>
@ddebroy
Copy link
Contributor Author

ddebroy commented Jun 11, 2019

Thanks for reviewing! Comments addressed.

@davidz627
Copy link
Contributor

/lgtm
great work!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 12, 2019
@k8s-ci-robot k8s-ci-robot merged commit b73cf2a into kubernetes-csi:master Jun 12, 2019
Migration: Beta automation moved this from In progress to Done Jun 12, 2019
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/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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants