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 charts url setting #43530

Merged
merged 7 commits into from
Jan 22, 2024
Merged

Conversation

weyfonk
Copy link
Contributor

@weyfonk weyfonk commented Nov 13, 2023

Issue: #43527

Problem

Testing any system chart against Rancher requires following one of these methods:

  • using a custom rancher/charts branch to be specified in CATTLE_CHART_DEFAULT_BRANCH, which would end up polluting rancher/charts with test branches
  • using airgap mode ("bundled") and building a custom repository to install a specific version of a Helm chart, which in turn requires running Rancher outside of a cluster or ADDing that custom repository over the clone in the rancher/rancher image
  • adding another layer to the Rancher image, which contains our bundled system chart version in the bundled repository

There should be an easier way.

Solution

Expose new environment variables and their corresponding settings for their respective charts repositories:

Environment variable Setting Repository
CATTLE_CHART_DEFAULT_URL ChartDefaultURL rancher/charts
CATTLE_PARTNER_CHART_DEFAULT_URL PartnerChartDefaultURL rancher/partner-charts
CATTLE_RKE2_CHART_DEFAULT_URL RKE2ChartDefaultURL rancher/rke2-charts

These options are intended for internal use only. When in use, Rancher issues a warning suggesting to unset it should any issues be encountered when fetching charts.

Testing

Engineering Testing

Manual Testing

Having set CATTLE_FLEET_VERSION to 103.1.0+up0.9.0-rc.5 (no longer available in rancher/charts branch dev-v2.8, since Fleet 0.9.0 has been un-RC-ed), tested the following use cases:

  1. Leaving new setting CATTLE_CHART_DEFAULT_URL unset: Fleet is installed in version 0.9.0 (bug fixed via [2.8] Fix check for exact version in Helm index #43498 ; using code from that PR leads to Rancher not installing Fleet and outputting an error instead, as expected)

  2. Setting CATTLE_CHART_DEFAULT_URL to an empty value: same behaviour as in 1.

  3. Having created a fork of rancher/charts, created a test-revert-0-9-0 branch on that fork, reverting the commit un-RC-ing Fleet 0.9.0, so that Fleet 0.9.0-rc.5 would be available on that branch. Set CATTLE_CHART_DEFAULT_BRANCH to test-revert-0-9-0 and CATTLE_CHART_DEFAULT_URL to the fork's URL, namely https://github.com/weyfonk/charts. Could see Fleet installed in version 0.9.0-rc.5.

Automated Testing

  • Test types added/modified:
    • None - unclear how to automatically test these changes: would a separate test charts repo be needed?

QA Testing Considerations

Regressions Considerations

N/A

Copy link
Member

@rohitsakala rohitsakala left a comment

Choose a reason for hiding this comment

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

Commented

rohitsakala
rohitsakala previously approved these changes Dec 15, 2023
This adds a new setting, named `CATTLE_CHART_DEFAULT_URL`, to control
the origin of system charts, which can now be tested with custom
versions prior to releasing corresponding RCs to `rancher/charts`.
This provides new options to replace URLs for those repositories, as
done for the system charts repository.

All three charts repositories may need to be replaced with custom repos
in test/CI setups.
This moves each default branch setting, for the partner and RKE2 charts
repositories, next to the default URL settings for the respective
repository, to make configuration easier and improve documentation.
This adds line breaks to avoid longer lines, which are harder to read
especially in diffs.
This needs to be done if the repo is found, now that the repo URL may
differ from the default one.
As dedicated settings are now available for all 3 charts repo types
(system, partner and RKE2), this commit adapts the warning message to
mention the repository type for which a URL has diverged from the
default.
This commit fixes a linting error by running `gofmt`.
@weyfonk weyfonk changed the base branch from release/v2.8 to release/v2.9 January 19, 2024 09:24
@weyfonk weyfonk merged commit 3e0974a into rancher:release/v2.9 Jan 22, 2024
2 checks passed
nickwsuse pushed a commit to nickwsuse/rancher that referenced this pull request Apr 5, 2024
* Add default chart URL setting

This adds new settings to control the origin of system, partner and RKE2
charts, which can now be tested with custom versions prior to releasing
corresponding RCs to their respective repositories:
* `ChartDefaultURL` (`rancher/charts`)
* `PartnerChartDefaultURL` (`rancher/partner- charts`)
* `RKE2ChartDefaultURL` (`rancher/rke2- charts`)

These options are intended for internal use only. When in use, Rancher
issues a warning suggesting to unset them should any issues be
encountered when fetching charts.

* Group settings by repo type

This moves each default branch setting, for the partner and RKE2 charts
repositories, next to the default URL settings for the respective
repository, to make configuration easier and improve documentation.
weyfonk added a commit to weyfonk/rancher that referenced this pull request Jun 6, 2024
* Add default chart URL setting

This adds new settings to control the origin of system, partner and RKE2
charts, which can now be tested with custom versions prior to releasing
corresponding RCs to their respective repositories:
* `ChartDefaultURL` (`rancher/charts`)
* `PartnerChartDefaultURL` (`rancher/partner- charts`)
* `RKE2ChartDefaultURL` (`rancher/rke2- charts`)

These options are intended for internal use only. When in use, Rancher
issues a warning suggesting to unset them should any issues be
encountered when fetching charts.

* Group settings by repo type

This moves each default branch setting, for the partner and RKE2 charts
repositories, next to the default URL settings for the respective
repository, to make configuration easier and improve documentation.
weyfonk added a commit that referenced this pull request Jun 13, 2024
* Add default chart URL setting

This adds new settings to control the origin of system, partner and RKE2
charts, which can now be tested with custom versions prior to releasing
corresponding RCs to their respective repositories:
* `ChartDefaultURL` (`rancher/charts`)
* `PartnerChartDefaultURL` (`rancher/partner- charts`)
* `RKE2ChartDefaultURL` (`rancher/rke2- charts`)

These options are intended for internal use only. When in use, Rancher
issues a warning suggesting to unset them should any issues be
encountered when fetching charts.

* Group settings by repo type

This moves each default branch setting, for the partner and RKE2 charts
repositories, next to the default URL settings for the respective
repository, to make configuration easier and improve documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants