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

Fix panic because VolumeSpec may be nil in volume reconstruction scenario #74493

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

cofyc
Copy link
Member

@cofyc cofyc commented Feb 25, 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:

Which issue(s) this PR fixes:

Fixes #74384

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. release-note-none Denotes a PR that doesn't merit a release note. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 25, 2019
@cofyc
Copy link
Member Author

cofyc commented Feb 25, 2019

/sig storage
/priority important-soon
/assign @msau42
cc @jingxu97

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Feb 25, 2019
@k8s-ci-robot k8s-ci-robot removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 25, 2019
@@ -732,7 +732,7 @@ func (og *operationGenerator) GenerateUnmountVolumeFunc(
podsDir string) (volumetypes.GeneratedOperations, error) {

var pluginName string
if useCSIPlugin(og.volumePluginMgr, volumeToUnmount.VolumeSpec) {
if volumeToUnmount.VolumeSpec != nil && useCSIPlugin(og.volumePluginMgr, volumeToUnmount.VolumeSpec) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should return an error in ConstructVolumeSpec() instead if we can't support reconstruction, like here.

This will cause the Unmount() to happen, which will fix the filesystem-based paths, however block-based paths will not work because UnmountDevice() is still not called.

Copy link
Member

Choose a reason for hiding this comment

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

Does raw block reconstruction have a similar issue? We don't have tests for raw block reconstruction: #74545

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I discussed some more with @jingxu97, and she pointed out that even if we return error in ConstructVolumeSpec(), the volumeSpec will still be nil here, so we still need this check.

It looks like this check was introduced as part of CSI migration. 1) This should be feature gated, and 2) can useCSIPlugin return false if volume spec is nil? Does that make sense for all operations? cc @davidz627

Copy link
Contributor

Choose a reason for hiding this comment

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

for 1) I've submitted a PR to make sure we do the migration feature gate check before doing anything else.

For 2) I think I need to do some more investigation and address it in the CSI Migration Reconstruction design.

@msau42
Copy link
Member

msau42 commented Feb 25, 2019

/lgtm
/approve
to fix the failing tests

We can followup on the remaining items, which I will open issues for

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 25, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cofyc, 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 Feb 25, 2019
@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 Feb 26, 2019
@cofyc
Copy link
Member Author

cofyc commented Feb 26, 2019

/hold
to check block device

@cofyc
Copy link
Member Author

cofyc commented Feb 26, 2019

/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 Feb 26, 2019
@k8s-ci-robot k8s-ci-robot merged commit c7a9a15 into kubernetes:master Feb 26, 2019
@cofyc cofyc deleted the fix74384 branch May 4, 2019 07:21
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/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. 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-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocalVolumeType: gce-localssd-scsi-fs tests are failing
4 participants