Repository navigation
feat(registry): add support for overriding image registry in Helm cha… - #4261
Conversation
|
|
2ad25ed to
246366e
Compare
|
/easycla |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4261 +/- ##
==========================================
+ Coverage 30.25% 30.28% +0.03%
==========================================
Files 478 478
Lines 23169 23179 +10
==========================================
+ Hits 7010 7020 +10
Misses 16159 16159
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| {{- include "tekton-operator.withRegistry" (dict "image" (printf "%s:%s" $image $tag) "registry" .Values.registry) -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "tekton-operator.pruner-image" -}} |
There was a problem hiding this comment.
for pruner image we shoulndt call withRegistry, otherwise there will be double override (the second is done pruner.go with TEKTON_REGISTRY_OVERRIDE
There was a problem hiding this comment.
i missed it... thx!
| {{- end -}} | ||
| {{- end -}} | ||
| {{- printf "%s:%s" $image $tag -}} | ||
| {{- include "tekton-operator.withRegistry" (dict "image" (printf "%s:%s" $image $tag) "registry" .Values.registry) -}} |
There was a problem hiding this comment.
same here for proxy webhook, it is already handled via IMAGE_PIPELINES_PROXY and TEKTON_REGISTRY_OVERRIDE
use withRegistry only for operator image (operator base image and webhook)
There was a problem hiding this comment.
i missed it... thx!
| @@ -211,14 +211,20 @@ func overrideImageRegistry(registry, imageName string) string { | |||
| return imageName | |||
There was a problem hiding this comment.
You may want to make this fonction idemptotent
if the image already starts with the override prefix, leave it alone. A second pass becomes a no-op.
There was a problem hiding this comment.
I added the logic for idempotent function. It helps in cases registry already set i.e. registries that include a path. With TEKTON_REGISTRY_OVERRIDE=myreg.io/mirror, an image that had already been rewritten (myreg.io/mirror/tektoncd/x) was treated as having the host myreg.io, so it became myreg.io/mirror/mirror/tektoncd/x.
|
@dadez73 can you squash commits |
…rt and components Ensure the image registry override is idempotent and update the documentation accordingly. Signed-off-by: Davide Doninelli <d.doninelli@gmail.com>
1f56ff0 to
459e70e
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jkhelil The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Add a single
registryvalue to the Helm chart to mirror every image to an internal registry (e.g. for air-gapped clusters), and makeTEKTON_REGISTRY_OVERRIDEcover the images it previously missed.Helm chart
registryvalue (host[:port][/path]). It rewrites the registry of the operator's own images (operator, webhook, webhook proxy, prunertkn) through a newtekton-operator.withRegistryhelper.TEKTON_REGISTRY_OVERRIDEon the operator containers, so the components the operator installs use the same mirror. ATEKTON_REGISTRY_OVERRIDEentry inoperator.additionalEnvstakes precedence.Operator
overrideImageRegistrynow treats the first path component as a registry host only if it contains.or:, or islocalhost(the Docker rule). Before this change,bitnami/postgresqllost itsbitnaminamespace; it now becomes<override>/bitnami/postgresql.replaceContainersArgsImageonly matches flags (args starting with-), skips the value after a matched flag, and ignores flags with no value. A flag's value is no longer read as a flag, and the last arg can no longer cause an out-of-range write.tknimage (IMAGE_JOB_PRUNER_TKN) now goes throughTEKTON_REGISTRY_OVERRIDEas well.Docs
docs/AirGapImageConfiguration.md: documents the host-detection rule, the*-image*flags and pruner rewriting, and the new Helmregistryvalue.Tests
pkg/reconciler/common/transformers_test.goand the fixturetestdata/test-replace-image-airgapped.yaml.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes