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

Grab snow device path via last character rather than trimming #1546

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

ConnorJC3
Copy link
Contributor

Is this a bug fix or adding new feature?

Bug fix

What is this PR about? / Why do we need it?

Due to #1518, volumes now start with /dev/xvda rather than /dev/xvdb. Because of this, the hardcoded path in the snow code stopped working, breaking mounting on snow devices. This change instead creates the snow device path based on the last character of the generated path, rather than trying to do it via trimming, which is unreliable.

Snow devices are currently limited to 10 volumes attached which makes this 100% safe, but this will need to be revisited if snow every adds suport for >26 volumes.

What testing is done?

Manual (with snow customer), added additional unit test case

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 27, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 27, 2023
Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

@TerryHowe: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@torredil
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2023
@@ -101,7 +101,7 @@ func (d *nodeService) findDevicePath(devicePath, volumeID, partition string) (st

if util.IsSBE(d.metadata.GetRegion()) {
klog.V(5).InfoS("[Debug] Falling back to snow volume lookup", "devicePath", devicePath)
canonicalDevicePath = "/dev/vd" + strings.TrimPrefix(devicePath, "/dev/xvdb")
canonicalDevicePath = "/dev/vd" + devicePath[len(devicePath)-1:]
Copy link
Contributor

Choose a reason for hiding this comment

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

np: Can you add a comment here explaining why you're doing this?

Copy link
Contributor

Choose a reason for hiding this comment

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

For my own understanding: the 26-volume limit doesn't exist for the current implementation, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdpsin - Comment added

@hanyuel - no, this is a limitation of both

Copy link
Contributor

Choose a reason for hiding this comment

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

Why both? I thought the 26-device limitation was from this change taking only the last character of devicePath while the current implementation just trims the prefix.

Due to kubernetes-sigs#1518, volumes now start with /dev/xvda rather than /dev/xvdb.
Because of this, the hardcoded path in the snow code stopped working,
breaking mounting on snow devices. This change instead creates the
snow device path based on the last character of the generated path,
rather than trying to do it via trimming, which is unreliable.

Snow devices are currently limited to 10 volumes attached which makes
this 100% safe, but this will need to be revisited if snow ever adds
suport for >26 volumes.

Signed-off-by: Connor Catlett <conncatl@amazon.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2023
@ConnorJC3
Copy link
Contributor Author

/retest

Is this the new test breakage :(

@ConnorJC3
Copy link
Contributor Author

/retest

Prow was actually broken, hopefully fixed now: kubernetes/test-infra#29167

@rdpsin
Copy link
Contributor

rdpsin commented Mar 29, 2023

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TerryHowe, torredil

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 Mar 29, 2023
@k8s-ci-robot k8s-ci-robot merged commit ed42e16 into kubernetes-sigs:master Mar 29, 2023
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/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.

6 participants