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 RepairVolumeHandle to the csi translation struct #83593

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

davidz627
Copy link
Contributor

RepairVolumeHandle is needed in VerifyVolumesAttached on the external attacher when we need to do strict volume handle matching to check VolumeAttachment attached status. Most Plugins will already have fully qualified volume handles but GCE PD sometimes does not have full information and has UNSPECIFIED so that needs to be repaired before we can verify whether that volume is attached.

/assign @msau42
/cc @ddebroy @leakingtapan

/kind feature

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2019
@k8s-ci-robot k8s-ci-robot added 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 Oct 7, 2019
@davidz627
Copy link
Contributor Author

/sig storage
/priority important-soon
/

@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. and 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 Oct 7, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidz627

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 Oct 7, 2019
staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go Outdated Show resolved Hide resolved
}

nodeTok := strings.Split(nodeID, "/")
if len(nodeTok) != volIDTotalElements {
Copy link
Member

Choose a reason for hiding this comment

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

is this right? node token has the same number of elements as volume id?

Copy link
Contributor Author

@davidz627 davidz627 Oct 7, 2019

Choose a reason for hiding this comment

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

yes - it is also fully qualified (projects/{project}/zones/{zone}/instances/{instanceName}) and is the same as the selfID given by GCE

if len(tok) != volIDTotalElements {
return "", fmt.Errorf("volume handle has wrong number of elements; got %v, wanted %v", len(tok), volIDTotalElements)
}
if tok[volIDProjectValue] != UnspecifiedValue {
Copy link
Member

Choose a reason for hiding this comment

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

Is this right? Can a project be unspecified?

Copy link
Member

Choose a reason for hiding this comment

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

Also if the project is unspecified, does that guarantee the zone/region is specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in migration project is always unspecified (that information isn't encoded in in-tree API objects at all). Zone/region is unspecified based on whether the zone label is applied to the PV or not (I think we are not always guaranteed that is the case especially in pre-provisioned or inline volumes).

So this will always fix the project - and sometimes fix the zone/region. Logic is kind of complicated so I have the unit test

staging/src/k8s.io/csi-translation-lib/plugins/gce_pd.go Outdated Show resolved Hide resolved
@davidz627 davidz627 force-pushed the feature/fuzzyMatch branch 2 times, most recently from 06b1b4c to b89b029 Compare October 8, 2019 00:19
@davidz627
Copy link
Contributor Author

/retest

@davidz627
Copy link
Contributor Author

@msau42 ready for next round of review

@msau42
Copy link
Member

msau42 commented Oct 8, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2019
@k8s-ci-robot k8s-ci-robot merged commit 8b5b6d6 into kubernetes:master Oct 9, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 9, 2019
@davidz627 davidz627 deleted the feature/fuzzyMatch branch October 9, 2019 04:02
ohsewon pushed a commit to ohsewon/kubernetes that referenced this pull request Oct 16, 2019
Add RepairVolumeHandle to the csi translation struct
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. 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/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.

None yet

3 participants