Skip to content

feat(api): support pinning image tags and digests#989

Open
przadzinski wants to merge 1 commit into
alexandrevilain:mainfrom
przadzinski:feat/image-tag-digest-override
Open

feat(api): support pinning image tags and digests#989
przadzinski wants to merge 1 commit into
alexandrevilain:mainfrom
przadzinski:feat/image-tag-digest-override

Conversation

@przadzinski

Copy link
Copy Markdown

What

Adds two optional fields — imageTag and imageDigest — to the server (spec), UI (spec.ui) and admin-tools (spec.admintools) specs, so the deployed image reference can be decoupled from version and pinned immutably.

imageTag imageDigest Resulting reference
unset unset image:version (unchanged)
set unset image:imageTag
unset set image:version@digest
set set image:imageTag@digest

Both are optional and fully backwards-compatible — when unset, the reference is exactly as today.

Why

Two long-standing needs, addressed by one small change:

  • imageTag — decouples the image tag from version. This is the request in Allow overriding admintools image tag #788 / Add tag config for server/ui/admintools images #789 (admin-tools/UI/server images are sometimes published under tags that don't match the Temporal version, which currently blocks deployment). @alexandrevilain — on Add tag config for server/ui/admintools images #789 you said you were happy to merge this direction once rebased with docs; that PR went stale, so this revisits it.
  • imageDigest — pins the image to an immutable digest (<image>:<tag>@<digest>) so the running image can't change behind a mutable tag. This is important for supply-chain / image-provenance requirements (e.g. PCI-DSS image pinning), where a semver tag alone isn't sufficient. The semver version field can't hold a digest and still drives schema migrations, so a separate field is the natural fit.

How

  • Image construction is centralised in a new meta.ContainerImage(repository, defaultTag, tagOverride, digest) helper, used by all four call sites (server, UI, admin-tools deployment, and the schema-setup job) — no duplicated logic.
  • For the server, version still drives the persistence schema version regardless of these overrides; only the deployed image reference changes.
  • CRD validation enforces the ^sha256:[a-fA-F0-9]{64}$ digest format.

Included

  • API fields + regenerated CRD (config/crd/bases) and api-docs (docs/api/v1beta1.md) via the pinned controller-gen v0.16.3
  • Unit test for the helper (internal/resource/meta/image_test.go)
  • A short feature doc (docs/features/image-pinning.md) + nav entry

make manifests generate, go vet, gofmt and the new test all pass. Deepcopy required no change (plain string fields). The release-time helm-chart CRD (charts/.../temporal-operator.crds.yaml) is regenerated during release per the Makefile, so I left it untouched — happy to include it if you'd prefer.

Refs #788, #789

Add optional `imageTag` and `imageDigest` fields to the server (`spec`),
UI (`spec.ui`) and admin tools (`spec.admintools`) specs.

Until now every image was deployed as `<image>:<version>`, which couples
the deployed tag to the cluster version (which also drives the persistence
schema migrations) and leaves the running image on a mutable tag.

- `imageTag` overrides the tag used for the image, falling back to
  `version` when unset. This addresses the long-standing request in
  alexandrevilain#788 / alexandrevilain#789 to decouple the admin-tools/ui/server image tag from the
  Temporal version.
- `imageDigest` pins the image to an immutable digest, appended as
  `<image>:<tag>@<digest>`, so the running image cannot change behind a
  mutable tag (image provenance / supply-chain hardening). CRD validation
  enforces the `sha256:<64 hex>` format.

Both fields are optional and backwards-compatible; when unset the image
reference is unchanged. Image construction is centralised in a new
`meta.ContainerImage` helper used by all four builders (server, ui,
admintools deployment and the schema-setup job) to avoid duplication.

For the server, `version` still drives the persistence schema version
regardless of these overrides — only the deployed image reference changes.

Refs alexandrevilain#788, alexandrevilain#789

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Patryk Rzadzinski <patryk@rzski.com>
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants