-
Notifications
You must be signed in to change notification settings - Fork 68
feat(helm): global values, and the registry/repository image split #143
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Helm Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| helm-test: | ||
| name: Run on Ubuntu | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Clone the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v4 | ||
|
|
||
| - name: Lint the chart | ||
| run: make helm-lint | ||
|
|
||
| # Pre-installed because modern helm verifies plugin provenance by | ||
| # default and the unittest plugin publishes none; the Makefile's own | ||
| # bootstrap (helm plugin install without --verify=false) predates that | ||
| # and fails on a fresh runner. With the plugin present, make helm-test | ||
| # skips its bootstrap. | ||
| - name: Install helm-unittest plugin | ||
| run: helm plugin install https://github.com/helm-unittest/helm-unittest --verify=false | ||
|
|
||
| # Enforced here rather than developer-run only -- a green PR previously | ||
| # said nothing about the chart tests. | ||
| - name: Run chart unit tests | ||
| run: make helm-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{/* | ||
| Copyright Broadcom, Inc. All Rights Reserved. | ||
| SPDX-License-Identifier: APACHE-2.0 | ||
| */}} | ||
|
|
||
| {{/* vim: set filetype=mustache: */}} | ||
| {{/* | ||
| Return the proper image name. | ||
| If image tag and digest are not defined, termination fallbacks to chart appVersion. | ||
| {{ include "kmcp.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global "chart" .Chart ) }} | ||
| */}} | ||
| {{- define "kmcp.images.image" -}} | ||
| {{- $registryName := default .imageRoot.registry ((.global).imageRegistry) -}} | ||
| {{- $repositoryName := .imageRoot.repository -}} | ||
| {{- $separator := ":" -}} | ||
| {{- $termination := .imageRoot.tag | toString -}} | ||
|
|
||
| {{- if not .imageRoot.tag }} | ||
| {{- if .chart }} | ||
| {{- $termination = .chart.AppVersion | toString -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- if .imageRoot.digest }} | ||
| {{- $separator = "@" -}} | ||
| {{- $termination = .imageRoot.digest | toString -}} | ||
| {{- end -}} | ||
| {{- if $registryName }} | ||
| {{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}} | ||
| {{- else -}} | ||
| {{- printf "%s%s%s" $repositoryName $separator $termination -}} | ||
| {{- end -}} | ||
| {{- end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The repository split changes the existing Helm fixtures from
test-repo:v1.0.0toghcr.io/test-repo:v1.0.0, but this PR only migrates the Go e2e caller.helm unittest helm/kmcppasses all 48 tests on the merge base and fails 18 tests at this head, with 18 snapshot failures in the deployment and RBAC suites. Should we update those fixtures and their expected output, and add cases for the new registry/global behavior? Or, if a fixture is intended to keep an unqualified image, setimage.registry: ""explicitly?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.
Yep, you're right. Updated the fixtures AND added a CI job to run helm unit tests, this would have been more visible had we been running these tests in CI.