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

support volume partition #824

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

AndyXiangLi
Copy link
Contributor

Is this a bug fix or adding new feature?
Fixes #812
What is this PR about? / Why do we need it?
Add volume partition support when stage&publish volumes to sync with in-tree driver
What testing is done?
unit test
e2e test

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AndyXiangLi

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 7, 2021
@AndyXiangLi
Copy link
Contributor Author

/test pull-aws-ebs-csi-driver-external-test-latest

1 similar comment
@AndyXiangLi
Copy link
Contributor Author

/test pull-aws-ebs-csi-driver-external-test-latest

@AndyXiangLi
Copy link
Contributor Author

/test pull-aws-ebs-csi-driver-e2e-single-az

@coveralls
Copy link

coveralls commented Apr 7, 2021

Pull Request Test Coverage Report for Build 1815

  • 39 of 50 (78.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 81.706%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/driver/controller.go 11 14 78.57%
pkg/driver/node_linux.go 4 12 33.33%
Totals Coverage Status
Change from base Build 1801: -0.08%
Covered Lines: 1791
Relevant Lines: 2192

💛 - Coveralls

return findNvmeVolume(nvmeName)
nvmeDevicePath, err := findNvmeVolume(nvmeName)
if err != nil {
//Return the nvmeDevicePath just for logging purpose
Copy link
Contributor

Choose a reason for hiding this comment

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

the callers never read the returned string though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

u r right... It is logging devicePath, will return empty string then

@wongma7
Copy link
Contributor

wongma7 commented Apr 7, 2021

Can we add an e2e test otherwise lgtm

@AndyXiangLi
Copy link
Contributor Author

/test pull-aws-ebs-csi-driver-migration-test-latest

@AndyXiangLi
Copy link
Contributor Author

@wongma7 @jsafrane Update the PR as migration test was failing. Notice that some migration test cases set partition as "0", so explicitly check that scenario and ignore partition 0. Please LMK if you have any idea on this

partition := ""
if part, ok := req.GetVolumeContext()[VolumeAttributePartition]; ok {
if part != "0" {
partition = part
Copy link
Contributor

Choose a reason for hiding this comment

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

should we validate it? Check that it's an integer? and not something crazy/malicious with weird paths and whatnot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, parse to int makes sense to me, is there any special rule for windows partition validation? should that be same?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can leave it same, I'll test it out later.

I think I will make the windows findDevicePath implementation ignore the partition arg. From my understanding, the windows mount code will always mount the first partition so it doesn't matter what partition is set to. https://github.com/kubernetes-csi/csi-proxy/blob/d47b9ecde8f020dd9d5eb2df3e56bf2f10a3f4a3/internal/os/volume/api.go#L87 (similarly, fstype gets ignored in windows world)

@wongma7
Copy link
Contributor

wongma7 commented Apr 9, 2021

/lgtm
thanks

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 9, 2021
@AndyXiangLi AndyXiangLi merged commit 21e5b06 into kubernetes-sigs:master Apr 9, 2021
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Volume partitions are not supported
4 participants