Skip to content

Split broker.image into separate repository and tag fields#243

Open
sbs-dev1 wants to merge 4 commits intopact-foundation:masterfrom
sbs-dev1:split-image-repo-tag
Open

Split broker.image into separate repository and tag fields#243
sbs-dev1 wants to merge 4 commits intopact-foundation:masterfrom
sbs-dev1:split-image-repo-tag

Conversation

@sbs-dev1
Copy link

@sbs-dev1 sbs-dev1 commented Feb 25, 2026

Summary

  • Split broker.image from a single string into broker.image.repository and broker.image.tag
  • Update broker.image helper in _helpers.tpl to support both formats (backward compatible)
  • Bump chart version to 5.6.0

Motivation

The current single-string format makes it difficult to override just the registry or just the tag independently. Separate fields are needed for:

  • Private registries: Organizations mirroring images internally need to swap the repository without touching the tag.
  • Automated image updates: Tools like ArgoCD Image Updater and Flux Image Automation expect separate repository/tag fields.
  • Policy enforcement: Tools like Kyverno and OPA Gatekeeper match on image repository to enforce allowed registries.

This is the standard pattern used by Bitnami, Prometheus community, Grafana, Argo, and most major Helm chart publishers.

Changes

values.yaml:

# Before
broker:
  image: ghcr.io/pact-foundation/pact-broker:2.137.0-pactbroker2.118.0

# After
broker:
  image:
    repository: ghcr.io/pact-foundation/pact-broker
    tag: 2.137.0-pactbroker2.118.0

templates/_helpers.tpl (backward compatible — accepts both formats):

{{- define "broker.image" -}}
{{- if kindIs "string" .Values.broker.image -}}
{{- .Values.broker.image -}}
{{- else -}}
{{- printf "%s:%s" .Values.broker.image.repository .Values.broker.image.tag -}}
{{- end -}}
{{- end -}}

No other templates need changes since they all use {{ template "broker.image" . }}.

Backward Compatibility

The template helper detects whether broker.image is a string (old format) or an object (new format), so existing deployments using --set broker.image=registry/image:tag continue to work without changes.

Validation

All validation steps from the contributing guidelines were executed successfully:

  • helm template — renders correctly with new format: ghcr.io/pact-foundation/pact-broker:2.137.0-pactbroker2.118.0
  • helm template --set broker.image=custom:tag — backward compat confirmed: custom:tag
  • helm lint — passed (1 chart linted, 0 failed)
  • ct lint — passed against both CI value files (default-values.yaml and external-database-with-secret-values.yaml)
Linting chart "pact-broker => (version: "5.6.0", path: "charts/pact-broker")"
Validating charts/pact-broker/Chart.yaml...
Validation success! 👍

Linting chart with values file "charts/pact-broker/ci/default-values.yaml"...
1 chart(s) linted, 0 chart(s) failed

Linting chart with values file "charts/pact-broker/ci/external-database-with-secret-values.yaml"...
1 chart(s) linted, 0 chart(s) failed

✔︎ pact-broker => (version: "5.6.0", path: "charts/pact-broker")
All charts linted successfully

@sbs-dev1 sbs-dev1 force-pushed the split-image-repo-tag branch 2 times, most recently from 9760549 to 7b5da74 Compare February 25, 2026 20:57
@sbs-dev1 sbs-dev1 force-pushed the split-image-repo-tag branch from 7b5da74 to 94a1cc6 Compare February 25, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant