-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Template functions for recommended kubernetes versions #10369
Conversation
return content | ||
} | ||
|
||
funcs["ChannelRecommendedKubernetesUpgradeVersion"] = func(version string) string { |
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.
These function names are pretty long.
This is essentially the recommended patch version for a given kubernetes version and the function below is the recommended minor+patch version for a given kops version.
How about:
ChannelRecommendedKubernetesPatchVersion
ChannelRecommendedKubernetesMinorVersion
or even just
ChannelKubernetesPatchVersion
ChannelKubernetesMinorVersion
?
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 the easiest functions to name :)
I mainly based the function names after the primary underlying function. I don't mind long function names; it boils down to what most intuitive for users.
I realise that channel is actually something we pass in as a value. Any thoughts? |
Yea, I don't have a strong opinion about how these should work or their name though I do see the value in having them. Perhaps your original names are sufficient. I do think its worthy of some documentation so that users don't have to dig into the source code to find the function names. I'm also wondering if not specifying --channel should use the default channel or not load any channel and have those functions fail somehow. I suppose it only really impacts airgapped environments since |
My documentation got lost somewhere ... I had actually written that. Those who run kops in airgapped envs could point to their local channel files. I would guess they have one in order to update their clusters as well. I'll dig up those docs again, add a bit of release notes, but otherwise keep this PR as is. There is sufficient time to change anything later on. And I have some more similar functions I want to add such as recommended image. Recommended image would also require cloud to be passed though. Which means either passing that as a variable or as another CLI arg similar to the channel discussion above. |
Yes, I think all of that sounds good 👍🏻 Airgapped users can use their local channel file but they'll need to know to add the |
Actually saving files to disk seems to make a difference ... docs pushed. |
@olemarkus: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
This LGTM. Once the conflict is resolved we can get it merged |
673fa24
to
d89a7a5
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: olemarkus, rifelpet 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 |
This PR implements two template functions for setting recommended k8s version based on info from the given channel.