-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
--kubernetes-version: assume latest patch version if not specified by user #16569
Conversation
|
Welcome @JudahNour! |
Hi @JudahNour. 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 Once the patch is verified, the new status will be reflected by the 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. |
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.
lets make
cmd/minikube/cmd/start.go
Outdated
@@ -1757,8 +1757,17 @@ $ minikube config unset kubernetes-version`) | |||
} else if strings.EqualFold(strings.ToLower(paramVersion), "latest") || strings.EqualFold(strings.ToLower(paramVersion), "newest") { | |||
paramVersion = constants.NewestKubernetesVersion | |||
} | |||
|
|||
nvs, err := semver.Make(strings.TrimPrefix(paramVersion, version.VersionPrefix)) | |||
kubernetesSemver := strings.TrimPrefix(paramVersion, version.VersionPrefix) |
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.
lets make sure we notify the user that we chose latest patch for them since they didn't provide a patch version
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.
also a better PR title would be, "--kubernetes-version: assume latest patch ver if not specified by user"
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.
Done. I abstracted out the majorMinor check and print it out in validateKubernetesVersion. The function uses the param version so this could be slightly redundant as we do that processing of the param in getKubernetesVersion already and thus redo some of it in validateKubernetesVersion so we can run the check there as well.
/check-cla |
Can one of the admins verify this patch? |
cmd/minikube/cmd/start.go
Outdated
@@ -1659,6 +1659,13 @@ func validateKubernetesVersion(old *config.ClusterConfig) { | |||
newestVersion := semver.MustParse(strings.TrimPrefix(constants.NewestKubernetesVersion, version.VersionPrefix)) | |||
zeroVersion := semver.MustParse(strings.TrimPrefix(constants.NoKubernetesVersion, version.VersionPrefix)) | |||
|
|||
paramVersion := viper.GetString(kubernetesVersion) |
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.
while we are at there could u plz check if captical V works too ? if not I suggest while we are touching this, convert the version to lowercase
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.
Capital V does not work. Do we want it so that the paramVersion is completely set to lowercase so that this is accounted for? Or do we want it to specifically set the first character to lowercase? I think the former would mean someone could input something like "StAble" as the flag and it would recognize it as "stable"
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.
yeah lets convert the user input to lowercase for all cases, that makes our life easier
kubernetesSemver = potentialPatch | ||
} else { | ||
return potentialPatch, ErrPatchNotFound | ||
} | ||
} | ||
nvs, err := semver.Make(kubernetesSemver) | ||
if err != nil { |
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.
Not sure if here we want to send back an error here instead of just exiting. With the error return value it could be better to now return an error and handle it outside getKubernetesVersion
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.
good point and good catch ! I think since it is already been implemented like that we can leave this one alone, and if we want we can refactor it in a follow up PR (for sake of keeping this PR small)
kubernetesSemver = potentialPatch | ||
} else { | ||
return potentialPatch, ErrPatchNotFound | ||
} | ||
} | ||
nvs, err := semver.Make(kubernetesSemver) | ||
if err != nil { |
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.
good point and good catch ! I think since it is already been implemented like that we can leave this one alone, and if we want we can refactor it in a follow up PR (for sake of keeping this PR small)
@JudahNour thank for updating the PR, do you mind also re-doing the Before/After after comming the last changes to ensure it is still good |
Corrected bug with version prefixes
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.
Run make generate-docs
to update translations
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 53.3s 53.4s 56.2s 52.2s 52.2s Times for minikube ingress: 28.2s 27.2s 27.2s 28.2s 27.7s docker driver with docker runtime
Times for minikube start: 21.8s 25.3s 22.2s 25.3s 25.8s Times for minikube ingress: 20.9s 20.4s 20.9s 21.9s 19.9s docker driver with containerd runtime
Times for minikube start: 20.4s 24.8s 21.3s 23.6s 24.0s Times for minikube ingress: 31.4s 46.4s 31.4s 19.4s 33.4s |
These are the flake rates of all failed tests.
To see the flake rates of all tests by environment, click here. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JudahNour, medyagh 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 |
looks good to me ! Congratulations on your first contribution ! looking forward to see more ! |
Closes #16558
Before:
After:
Before:
After:
After: