-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubeadm: Allows to use versions like 1.6.4 instead v1.6.4 #48507
Conversation
Hi @kad. 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 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. |
/ok-to-test |
@mikedanese @pipejakob @timothysc @jbeda @ixdy What do you think of this? |
@luxas I don't think the |
@ixdy Good, point. Then I'm not sure why |
Actually versionMatchRE in pkg/util/version will handle both variants with and without v. But in this particular case inside kubeadm we need to anyway transform it to form "vX.Y.Z" as it will be used for tags in registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style nit
I guess I'm ok with this then ;)
cmd/kubeadm/app/util/version.go
Outdated
@@ -49,7 +49,11 @@ var ( | |||
// latest-1.0 (and similarly 1.1, 1.2, 1.3, ...) | |||
func KubernetesReleaseVersion(version string) (string, error) { | |||
if kubeReleaseRegex.MatchString(version) { | |||
return version, nil | |||
if version[0] == 'v' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
if strings.HasPrefix(version, "v") {
return version, nil
}
return fmt.Sprintf("v%s", version), nil
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first part (HasPrefix) ok, will update. for fmt.Sprintf, I think for such trivial operation, + operator will be a lot faster than Sprintf.
As part of issue kubernetes/kubeadm#292 discussion, it turned out that for users it is not always obvious that version specification parameter must be in form "vX.Y.Z". This patch allows to specify it in form "X.Y.Z" and converts it internally to normal semantic version which expected in the rest of the code.
flake ? :( |
looks like it. |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kad, luxas Associated issue: 292 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 |
/retest |
flakes, flakes... seems like some race conditions in test infra. :( |
/retest |
1 similar comment
/retest |
/retest |
1 similar comment
/retest |
/test pull-kubernetes-e2e-kops-aws |
Automatic merge from submit-queue (batch tested with PRs 48196, 42783, 48507, 47719, 46138) |
@kad PR needs rebase |
What this PR does / why we need it:
As part of issue kubernetes/kubeadm#292 discussion, it
turned out that for users it is not always obvious that
version specification parameter must be in form "vX.Y.Z".
This patch allows to specify it in form "X.Y.Z" and
converts it internally to normal semantic version which
expected in the rest of the code.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged):Special notes for your reviewer:
Release note: