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

Add New Settings for RKE2/K3S Default Versions #37163

Merged

Conversation

jiaqiluo
Copy link
Member

@jiaqiluo jiaqiluo commented Apr 1, 2022

Issue: #36827

Problem

The default rke2/k3s version should be configurable per rancher version.
Both the default rke2/k3s version and rancher version need to be a range so we do not need to add a new entry each time when we release a new rancher version.

Solution

Rancher will get the version ranges from the channelserver, calculate the default versions for the current rancher version, and expose them as new Settings items:

  • rke2-default-version
  • k3s-default-version

And they are available under the /v1/management.cattle.io.settings endpoint automatically.

Dependency

We need to add the support for appDefaults to the channelsesrver : rancher/channelserver#17

Testing

  • the correct default versions show up in the settings after rancher runs up
  • the correct default versions show up in the settings when the external KDM is not accessible or out-of-date. This is to simulate the airgap environment.
  • the default versions are updated correctly after corresponding values are updated in the KDM

Note

To make the CI pass, this PR replaces the rancher/channelserver module with my fork. It will be switched back once the above PR to the channel server is merged.
Update: the PR in rancher/channelsever was merged and we switched back to use the latest commit for it.

@jiaqiluo jiaqiluo requested review from kinarashah, thedadams, Oats87 and a team April 1, 2022 22:10
@jiaqiluo jiaqiluo marked this pull request as ready for review April 1, 2022 22:10
pkg/settings/setting.go Outdated Show resolved Hide resolved
pkg/settings/setting.go Outdated Show resolved Hide resolved
@jiaqiluo jiaqiluo force-pushed the new-settings-for-default-verions branch from 6a16810 to 56e849c Compare April 4, 2022 16:21
@jiaqiluo jiaqiluo requested a review from paynejacob April 4, 2022 16:21
paynejacob
paynejacob previously approved these changes Apr 4, 2022
thedadams
thedadams previously approved these changes Apr 4, 2022
@jiaqiluo jiaqiluo dismissed stale reviews from thedadams and paynejacob via d22c43a April 5, 2022 17:28
@jiaqiluo jiaqiluo force-pushed the new-settings-for-default-verions branch from 56e849c to d22c43a Compare April 5, 2022 17:28
@jiaqiluo
Copy link
Member Author

jiaqiluo commented Apr 5, 2022

Hi @thedadams @paynejacob , this PR is ready for your final review.
The changes since your last approval are:

  • switch from my fork to rancher/channelserver in go.mod
  • squash and rebase the PR

@jiaqiluo jiaqiluo force-pushed the new-settings-for-default-verions branch 2 times, most recently from 177b862 to 1634ad8 Compare April 5, 2022 17:44
…m as Settings, they are available under the "/v1/management.cattle.io.settings" endpoint automatically.

Signed-off-by: Jiaqi Luo <6218999+jiaqiluo@users.noreply.github.com>
@jiaqiluo jiaqiluo force-pushed the new-settings-for-default-verions branch from 1634ad8 to a648ccd Compare April 5, 2022 17:45
@jiaqiluo jiaqiluo requested a review from a team April 6, 2022 15:59
pkg/channelserver/channelserver.go Show resolved Hide resolved
@jiaqiluo jiaqiluo merged commit 50d85b5 into rancher:release/v2.6 Apr 6, 2022
@jiaqiluo jiaqiluo deleted the new-settings-for-default-verions branch April 6, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants