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

Reduce volume name length for vsphere #96533

Merged
merged 1 commit into from Nov 18, 2020

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Nov 12, 2020

Reduce length of volume name for vsphere, so as not to make mount paths longer than necessary. This does not guarantee that volume path will be shorter than 180 chars but it will drop the volume prefix if volume name happens to be longer than 180 chars.

/sig storage

Reduce volume name length for vsphere volumes

@k8s-ci-robot k8s-ci-robot added 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. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 12, 2020
@gnufied
Copy link
Member Author

gnufied commented Nov 12, 2020

/kind bug
/priority important-soon
/triage accepted

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 12, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied

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 12, 2020
@gnufied
Copy link
Member Author

gnufied commented Nov 12, 2020

/assign @jsafrane @divyenpatel

@msau42
Copy link
Member

msau42 commented Nov 12, 2020

/assign @misterikkit @yuga711

@k8s-ci-robot
Copy link
Contributor

@msau42: GitHub didn't allow me to assign the following users: yuga711.

Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @misterikkit @yuga711

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.

@msau42
Copy link
Member

msau42 commented Nov 12, 2020

/milestone v1.20

@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Nov 12, 2020
@gnufied
Copy link
Member Author

gnufied commented Nov 13, 2020

/retest

// and systemd has a limit of 256 chars in a unit name - https://github.com/systemd/systemd/pull/14294
// so if we subtract the kubelet path prefix from 256, we are left with 191 characters but because some characters
// will be escaped we are deliberating choosing a lower value of 180.
name := volumeutil.GenerateVolumeName(v.options.ClusterName, v.options.PVName, 180)
Copy link
Member

Choose a reason for hiding this comment

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

IMO the name must be much shorter than 180. We add [<datastore>] - <uuid>/ to it, where every "[]-" character is escaped as 4 characters by systemd.

For example, if we leave 20 characters for datastore names, such volume is mounted to

/var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/[12345678901234567890] 31dc869f-aae9-4580-9d63-9461241123b0/<name>

That leaves 109 characters for <name> itself. Would be 90 a better number? That allows users to use datastore names with 39 characters (or less, if they use dashes that are escaped).

Copy link
Member

Choose a reason for hiding this comment

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

+1 on truncating the name a bit more (as we have the uuid) and leave more room to the datastore name

Copy link
Member

Choose a reason for hiding this comment

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

Is GenerateVolumeName only called on Create? Only updating the expected name here can break compatibility with other callers that expect 255 characters still.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it is only called on create and nowhere else. Updated the length to be 90 characters.

Copy link
Member

Choose a reason for hiding this comment

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

Does changing the name here impact things like reconstruction/upgrades?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope. The volumeName is stored and always retrieved from PV and since we aren't changing name of existing PVs we should be fine.

@dims
Copy link
Member

dims commented Nov 14, 2020

/assign @yastij @andrewsykim

Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

other reviewers, feel free to unhold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 17, 2020
@msau42
Copy link
Member

msau42 commented Nov 18, 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 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 160c33a into kubernetes:master Nov 18, 2020
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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants