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

Create target directory if it doesn't exist #303

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

huffmanca
Copy link
Contributor

@huffmanca huffmanca commented Nov 11, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
After https://github.com/kubernetes/kubernetes/pull/88759/files we need to create the staging and target directories if they don't exist.

Which issue(s) this PR fixes:
Fixes #304

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Updates the mock driver to create the target directory in `NodePublishVolume`, and remove it in `NodeUnpublishVolume`.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 11, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 11, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 11, 2020
mock/service/node.go Outdated Show resolved Hide resolved
pkg/sanity/sanity.go Outdated Show resolved Hide resolved
@msau42 msau42 mentioned this pull request Nov 11, 2020
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 11, 2020
mock/service/node.go Outdated Show resolved Hide resolved
mock/service/node.go Outdated Show resolved Hide resolved
@pohly
Copy link
Contributor

pohly commented Nov 11, 2020

The part that isn't clear to me is which tests are run against the CSI mock driver and why. https://github.com/kubernetes/kubernetes/blob/dd4560370743e94c9d5a477370bf25ffb49e973e/test/e2e/storage/csi_volumes.go#L31 explicitly mentions that the testsuites tests are not run against the mock diver.

@msau42
Copy link
Collaborator

msau42 commented Nov 11, 2020

we're specifically looking at test cases in https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/csi_mock_volume.go, which tests imitates different permutations of csi drivers.

mock/service/node.go Outdated Show resolved Hide resolved

// Check to see if the volume has already been unpublished.
if v.VolumeContext[nodeMntPathKey] == "" {
return &csi.NodeUnpublishVolumeResponse{}, nil
}

// Delete any created paths
delete(v.VolumeContext, nodeMntPathCreated)
err := os.RemoveAll(v.VolumeContext[nodeMntPathKey])
Copy link
Collaborator

Choose a reason for hiding this comment

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

@msau42
Copy link
Collaborator

msau42 commented Nov 11, 2020

/lgtm
/approve

/hold
Can you update the PR title, and also add a release note?

@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 Nov 11, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: huffmanca, msau42

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 Nov 11, 2020
@huffmanca huffmanca changed the title Create staging and target dirs if they don't exist Create target directory if it doesn't exist Nov 11, 2020
@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 release-note-none Denotes a PR that doesn't merit a release note. labels Nov 11, 2020
@huffmanca
Copy link
Contributor Author

@msau42

The title has been updated, a release note added, and the created issue linked.

@msau42
Copy link
Collaborator

msau42 commented Nov 11, 2020

/hold cancel

@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 Nov 11, 2020
@k8s-ci-robot k8s-ci-robot merged commit 9c8f5d1 into kubernetes-csi:master Nov 11, 2020
k8s-ci-robot added a commit that referenced this pull request Nov 12, 2020
Cherry pick #303 to release-3.1: Create target dir if it doesn't exist
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify that publish targetPath exists after NodePublish
4 participants