fix: make TEKTON_REGISTRY_OVERRIDE apply to all images#3754
Conversation
Previously the override only rewrote images already present in the per-component IMAGE_* env var map, leaving the defaults baked into component manifests untouched, and existing TektonInstallerSets never refreshed when only the registry override changed on an existing install. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3754 +/- ##
==========================================
+ Coverage 25.55% 25.61% +0.06%
==========================================
Files 448 448
Lines 23317 23330 +13
==========================================
+ Hits 5958 5976 +18
+ Misses 16674 16671 -3
+ Partials 685 683 -2
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:
|
Changes
Previously the override only rewrote images already present in the per-component
IMAGE_*env var map, leaving the defaults baked into component manifests untouched, and existingTektonInstallerSetsnever refreshed when only the registry override changed on an existing install.TEKTON_REGISTRY_OVERRIDEwas introduced in #2863 (docs in #2865, originally requested in #2684 / #2855) but only rewrote images that already had a matching per-imageIMAGE_*env var set. This is exactly the gap reported in #3270 ("Rewrite image registry Not working", still open) and previously in #2873 ("only one of the resulting containers correctly refers to the override registry, all other pods still refer to the default location").This PR makes
TEKTON_REGISTRY_OVERRIDEalone sufficient to rewrite every image, and fixes existing installs to pick up the change automatically:replaceContainerImages(Deployment/StatefulSet/Job containers),replaceStepsImages(Task/ClusterTask steps) andreplaceStepActionImages(StepAction) now fall back to rewriting the registry host of the image already present in the manifest when no per-image env var matches it, instead of leaving it untouched. Tekton variable substitutions ($(params.foo)) are explicitly excluded from this fallback since they aren't literal image references.TektonInstallerSetspec-hash (specHashInput) now includesTEKTON_REGISTRY_OVERRIDE, so changing it on an existing install triggers a refresh of the installer sets on the next reconcile instead of requiring a manualkubectl delete tektoninstallerset.docs/AirGapImageConfiguration.mdupdated to reflect the new behavior.Note: #3270 also reports that some
arg:-based image overrides (IMAGE_TRIGGERS_ARG__EL_IMAGE,IMAGE_PIPELINES_ARG__WORKINGDIRINIT_IMAGE) don't apply even when set explicitly. That's a separate, pre-existing bug inreplaceContainersArgsImageunrelated to the registry-override fallback and isn't addressed here.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PR (make test-unitpasses;make lint-gocould not download golangci-lint in this sandbox - checksum mismatch fetching the release binary, unrelated to this change)See the contribution guide for more details.
Release Notes