Skip to content

feat: Add support for force registry relocation - #715

Open
eklatzer wants to merge 1 commit into
hauler-dev:mainfrom
eklatzer:feat/force-registry-relocate
Open

feat: Add support for force registry relocation#715
eklatzer wants to merge 1 commit into
hauler-dev:mainfrom
eklatzer:feat/force-registry-relocate

Conversation

@eklatzer

@eklatzer eklatzer commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hey, this PR is not meant to be merged and more the baseline for a discussion for a feature request.

We are using Rancher Hauler to sync container images and Helm charts to our airgapped registry. We are then customizing the imported assets (e.g. by building wrapper charts with additional resources and additional configuration). Additionally, we are building custom container images and Helm charts. We want to use Hauler in our airgapped environment to generate a haul that is based on the previously imported and also custom assets. The biggest challenge doing this, was the fact, that the Helm charts sometimes still reference public container images like quay.io/argoproj/argocd:v3.5.0 that need a rewrite to our internal registry for building the haul. In RKE2 we solve this topic using the registries.yaml described in https://docs.rke2.io/install/private_registry using containerd rewrites.

Do you know of any known architectures, solving this issue? Does Hauler already support this use-case?

Example usage of the current PR:

★ ./hauler store sync --force-registry --registry internal-registry.something.com/path -f out/default/argocd.yaml -p linux/amd64 -l debug
2026-08-07 10:44:44 DBG running cli command [hauler store sync]
2026-08-07 10:44:44 DBG defaulted $DOCKER_CONFIG to [/home/user/.docker] for registry credential resolution
2026-08-07 10:44:44 DBG using store at [/opt/haulbot/store]
2026-08-07 10:44:44 DBG generated store id of [f30c3747-2919-4294-bd17-ad5291df427a]
2026-08-07 10:44:44 DBG using temporary directory at [/tmp/hauler2673304074]
2026-08-07 10:44:44 INF processing manifest [out/default/argocd.yaml] to store [/opt/haulbot/store]
2026-08-07 10:44:44 INF syncing content [content.hauler.cattle.io/v1] with [kind=Charts] to store [/opt/haulbot/store]
2026-08-07 10:44:44 DBG adding chart [argo-cd] to the store
2026-08-07 10:44:45 DBG generated audit id of [019fdb65-6b2d-7ebc-a211-3b0ac617dfb7] chart=argo-cd
2026-08-07 10:44:45 DBG extracting chart archive [3dcbeba98dbaab8e864d57f31325550e14d67cf5d364fbea3346c9d30683a71c.chart] chart=argo-cd
2026-08-07 10:44:45 DBG image references identified for helm template: [2] image(s) chart=argo-cd
2026-08-07 10:44:45 DBG image references identified for helm chart annotations: [0] image(s) chart=argo-cd
2026-08-07 10:44:45 DBG image references identified for helm image lock file: [0] image(s) chart=argo-cd
2026-08-07 10:44:45 DBG successfully parsed and deduped image references: [2] image(s) chart=argo-cd
2026-08-07 10:44:45 DBG successfully parsed image references [ecr-public.aws.com/docker/library/redis:8.2.3-alpine quay.io/argoproj/argocd:v3.5.0] chart=argo-cd
2026-08-07 10:44:45 INF identified [2] image(s) in [argo-cd:4.3.1]
2026-08-07 10:44:45 DBG relocating image ecr-public.aws.com/docker/library/redis:8.2.3-alpine to registry internal-registry.something.com/path chart=argo-cd
2026-08-07 10:44:45 DBG relocating image quay.io/argoproj/argocd:v3.5.0 to registry internal-registry.something.com/path chart=argo-cd
2026-08-07 10:44:45 INF ✓ added hauler/argo-cd:4.3.1 (1 layer, 288 kB, 0.6s)
2026-08-07 10:44:45 INF identified 2 unique image(s) across 1 chart(s)
2026-08-07 10:44:45 DBG adding image [internal-registry.something.com/path/argoproj/argocd:v3.5.0] to the store
2026-08-07 10:44:45 DBG adding image [internal-registry.something.com/path/docker/library/redis:8.2.3-alpine] to the store
2026-08-07 10:44:45 INF rewriting [internal-registry.something.com/path/docker/library/redis:8.2.3-alpine] to [ecr-public.aws.com/docker/library/redis:8.2.3-alpine]
2026-08-07 10:44:45 DBG generated audit id of [019fdb65-6b2d-7ebc-a211-3b0ac617dfb7] image=internal-registry.something.com/path/docker/library/redis:8.2.3-alpine
2026-08-07 10:44:45 INF ✓ added internal-registry.something.com/path/docker/library/redis:8.2.3-alpine (7 layers, 28 MB, 0.5s)
2026-08-07 10:44:46 INF rewriting [internal-registry.something.com/path/argoproj/argocd:v3.5.0] to [quay.io/argoproj/argocd:v3.5.0]
2026-08-07 10:44:46 DBG generated audit id of [019fdb65-6b2d-7ebc-a211-3b0ac617dfb7] image=internal-registry.something.com/path/argoproj/argocd:v3.5.0
2026-08-07 10:44:46 INF ✓ added internal-registry.something.com/path/argoproj/argocd:v3.5.0 (16 layers, 210 MB, 1.4s)
2026-08-07 10:44:46 INF processing completed successfully


★ ./hauler store info
┌──────────────────────────────────────────────────────┬───────┬─────────────┬───────────┬──────────┐
│ REFERENCE                                            │ TYPE  │ PLATFORM    │ #  LAYERS │ SIZE     │
├──────────────────────────────────────────────────────┼───────┼─────────────┼───────────┼──────────┤
│ ecr-public.aws.com/docker/library/redis:8.2.3-alpine │ image │ linux/amd64 │ 7         │ 27.5 MB  │
│ hauler/argo-cd:4.3.1                                 │ chart │ -           │ 1         │ 288.1 kB │
│ quay.io/argoproj/argocd:v3.5.0                       │ image │ linux/amd64 │ 16        │ 209.9 MB │
├──────────────────────────────────────────────────────┼───────┼─────────────┼───────────┼──────────┤
│ store-path: /opt/haulbot/store                       │       │             │     Total │ 237.7 MB │
│ store-id: f30c3747-2919-4294-bd17-ad5291df427a       │       │             │           │          │
└──────────────────────────────────────────────────────┴───────┴─────────────┴───────────┴──────────┘

The change of the current PR just solves it to some degree, but having broader support for a registries.yaml like the following one would be my proposal:

mirrors:
  docker.io:
    endpoint:
      - "https://registry.example.com:5000"
    rewrite:
      "^rancher/(.*)": "mirrorproject/rancher-images/$1"

Thanks in advance 😊

Signed-off-by: Eric Klatzer <eric@klatzer.at>
@github-project-automation github-project-automation Bot moved this to To Triage in Hauler Aug 7, 2026
@eklatzer

eklatzer commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Hey @zackbradys and @amartin120, would be nice to get your opinion regarding this discussion. After defining a way to handle this, I would go on with the implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant