feat: add global.imageRegistry to prefix all chart images - #1192
Open
alexandrust88 wants to merge 1 commit into
Open
alexandrust88 wants to merge 1 commit into
alexandrust88 wants to merge 1 commit into
Conversation
…n optional global.imageRegistry value. When set, it is prepended to every image in the chart (server, injector, injector agent, CSI provider, and CSI agent) via a new vault.imageRegistry helper. When unset, image rendering is unchanged (each component's image.repository is used as-is), so the change is fully backwards compatible. This lets operators repoint all chart images at a single private mirror or air-gapped registry with one value instead of overriding each per-component image.repository individually. - add vault.imageRegistry helper in templates/_helpers.tpl - wire helper into server, injector, injector agent, csi, csi agent images - document global.imageRegistry in values.yaml and values.schema.json - add unit tests for server, injector, and csi (set and unset)
alexandrust88
force-pushed
the
feat/global-image-registry
branch
from
June 30, 2026 15:27
a2a7750 to
6ca0766
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds an optional
global.imageRegistryvalue to the chart. When set, it is prepended to every image rendered by the chart:server.image— server StatefulSet and the server test pod (templates/server-statefulset.yaml,templates/tests/server-test.yaml)injector.image— agent-injector Deployment (templates/injector-deployment.yaml)injector.agentImage— theAGENT_INJECT_VAULT_IMAGEvalue used for injected Vault Agent sidecars (templates/injector-deployment.yaml)csi.image— CSI provider DaemonSet (templates/csi-daemonset.yaml)csi.agent.image— CSI Vault Agent sidecar (templates/csi-daemonset.yaml)A new
vault.imageRegistryhelper intemplates/_helpers.tplperforms the prefixing. Whenglobal.imageRegistryis empty (the default), image rendering is unchanged — each component'simage.repositoryis used exactly as before — so the change is fully backwards compatible.Why
When mirroring images to a single private registry (air-gapped or otherwise restricted environments), operators currently have to override each component's
image.repositoryindependently and keep all of them in sync. A singleglobal.imageRegistryvalue lets the entire chart be repointed at one mirror in one place, matching the common pattern used by many other Helm charts.This is a registry-prefix-only global. It does not reintroduce a shared
global.image, so it does not recreate the cross-subchart collision that led to removing global image configuration in #68 / #103: each component keeps its ownimage.repository, and only the registry host is prefixed.How it works
The helper returns the registry prefix (with a trailing slash) when the value is set, and an empty string otherwise:
Each image line is prefixed with
{{ include "vault.imageRegistry" . }}, for example:Example
Renders:
registry.example.com/hashicorp/vault:2.0.2registry.example.com/hashicorp/vault-k8s:1.7.4AGENT_INJECT_VAULT_IMAGE)registry.example.com/hashicorp/vault:2.0.2registry.example.com/hashicorp/vault-csi-provider:1.7.2registry.example.com/hashicorp/vault:2.0.2Leaving
global.imageRegistryunset keepshashicorp/vault:2.0.2etc. — identical to current behavior.Changes
templates/_helpers.tpl— newvault.imageRegistryhelpertemplates/server-statefulset.yaml,templates/tests/server-test.yaml,templates/injector-deployment.yaml,templates/csi-daemonset.yaml— wire the helper into all image referencesvalues.yaml— documentglobal.imageRegistry(defaults to"")values.schema.json— addglobal.imageRegistry(string)test/unit/server-statefulset.bats,test/unit/injector-deployment.bats,test/unit/csi-daemonset.bats— add tests for set and unset behaviorCHANGELOG.md— add entry under UnreleasedTests
global.imageRegistryis set, and the unchanged default when it is unset, for the server StatefulSet, injector Deployment (both the injector image and the injected agent image), and CSI DaemonSet (provider and agent containers).helm lintpasses.Backwards compatibility
No behavior change when
global.imageRegistryis unset; rendered output is identical to before. No existing values are renamed or removed.PCI review checklist
Revert plan: revert this PR. The change is additive and gated on
global.imageRegistrybeing set. With it unset, rendered manifests are byte-identical to the previous behavior, so no data migration or follow-up cleanup is required.Impact on security controls: none. No access control methods, authentication, authorization, or logging pipelines are added, removed, or modified. The only effect is an optional registry-host prefix applied to image references, which can additionally help enforce pulling images from an approved internal registry.