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

Automated cherry pick of #48326 #53172

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Sep 28, 2017

What this PR does / why we need it:
Azure file share name has a length limit of 63, but currently the code is using data volume's limit 75.

Which issue this PR fixes
cherry-pick fix of #48326
With current implementation, when the cluster name is long, the resulting file share name could have a length of 75.

Also function GenerateVolumeName would produce double '-' when clusterName containing '-' is to be truncated.

In both cases, service would reject the creating file share request.

Special notes for your reviewer:
Please refer to:
https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata#share-names

Share names must be from 3 through 63 characters long.
The name cannot contain two consecutive hyphens.

Release note:

Fix the issue: could not create an azure file when k8s cluster name lenght > 15 

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 28, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @andyzhangx. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

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. I understand the commands that are listed here.

@k8s-github-robot k8s-github-robot added do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. 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 Sep 28, 2017
@andyzhangx
Copy link
Member Author

@feiskyer

@feiskyer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 28, 2017
@feiskyer
Copy link
Member

/release-note

@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 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 Sep 28, 2017
@feiskyer
Copy link
Member

@andyzhangx please refer old PR #48326 in the title, e.g. Automated cherry pick of #48326

@andyzhangx andyzhangx changed the title Fix share name generation in azure file provisioner. Automated cherry pick of #48326 Sep 28, 2017
@feiskyer
Copy link
Member

/retest

name := volume.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 75)
// File share name has a length limit of 63, and it cannot contain two consecutive '-'s.
name := volume.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 63)
name = strings.Replace(name, "--", "-", -1)
capacity := a.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
Copy link
Member

Choose a reason for hiding this comment

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

Some test/docs would be nice about why we are doing what we are doing and also making sure it doesn't regress.

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, I will add azure file test case in master branch first, since this is only a cherry pick, shall we merge this PR first?

Copy link
Member

Choose a reason for hiding this comment

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

@gnufied agreed with andy, this is a cherry-pick aimed to fix a critical bug.

Copy link
Member

Choose a reason for hiding this comment

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

The original PR was opened without cherry-pick title I think, so I didn't think it was a cherry-pick.

@gnufied
Copy link
Member

gnufied commented Sep 29, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2017
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-gce-bazel

@gnufied
Copy link
Member

gnufied commented Oct 7, 2017

/approve

@gnufied
Copy link
Member

gnufied commented Oct 7, 2017

@andyzhangx can you link the github issue this PR fixes?

@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-gce-bazel

2 similar comments
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-gce-bazel

@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-gce-bazel

@andyzhangx
Copy link
Member Author

andyzhangx commented Oct 10, 2017

@gnufied I have updated the release-note field, let me know if that's ok, thx

@gnufied
Copy link
Member

gnufied commented Oct 10, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, gnufied

Associated issue requirement bypassed by: gnufied

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 10, 2017
@andyzhangx
Copy link
Member Author

@brendanburns could you approve, thx

@feiskyer
Copy link
Member

/assign @wojtek-t
1.7 branch manager

@feiskyer
Copy link
Member

@wojtek-t could you help to approve the cherry-pick? thanks.

@wojtek-t wojtek-t added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. and removed do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. labels Nov 14, 2017
@wojtek-t
Copy link
Member

Approved.

@wojtek-t wojtek-t added this to the v1.7 milestone Nov 14, 2017
@feiskyer
Copy link
Member

@wojtek-t thanks

@wojtek-t
Copy link
Member

/retest

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue.

@k8s-github-robot k8s-github-robot merged commit 74a6c4f into kubernetes:release-1.7 Nov 15, 2017
@andyzhangx andyzhangx deleted the automated-cherry-pick-of-#48326-upstream-release-1.7-1506563999 branch November 20, 2017 02:18
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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

None yet

9 participants