Skip to content

Expand ${...} image tags using availableVersions#58

Merged
tamalsaha merged 1 commit into
masterfrom
arnob-dbver-expand
Jul 12, 2026
Merged

Expand ${...} image tags using availableVersions#58
tamalsaha merged 1 commit into
masterfrom
arnob-dbver-expand

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

Problem

kubestash addon Function resources (rendered by the kubedb-kubestash-catalog chart) carry an image whose tag has a ${DB_VERSION}-style placeholder alongside a sibling availableVersions list:

spec:
  availableVersions: ["16.4", "17.2", "18.2"]
  image: ghcr.io/kubedb/postgres-restic-plugin:v0.29.0_${DB_VERSION}

lib.collectImages stored the raw templated string, and ListImages/GroupImages drop anything containing ${. As a result these plugin images silently never made it into imagelist.yaml.

Change

  • collectImages now runs each image value through expandVersionedImage, which substitutes a ${...} placeholder with every entry in the object's availableVersions list, emitting one concrete image per version.
  • No placeholder, or no usable availableVersions → returned unchanged, so the existing ${ filter still drops any genuinely unresolvable templated image (no regression).

For the example above, list now emits:

ghcr.io/kubedb/postgres-restic-plugin:v0.29.0_16.4
ghcr.io/kubedb/postgres-restic-plugin:v0.29.0_17.2
ghcr.io/kubedb/postgres-restic-plugin:v0.29.0_18.2

ace_up.go's separate collectImages is left untouched — that flow only reads PostgresVersion/RedisVersion from the kubedb-catalog chart, never these kubestash Function resources.

Test

Added pkg/lib/image_test.go covering the Function shape and the helper's edge cases. go build ./... and the new tests pass.

kubestash addon Function resources carry an image tag with a
${DB_VERSION}-style placeholder alongside an availableVersions list.
collectImages now expands the placeholder into one concrete image per
available version instead of emitting the templated string (which was
silently dropped by the ${ filter in ListImages/GroupImages).

Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
@tamalsaha
tamalsaha merged commit a8bd992 into master Jul 12, 2026
4 checks passed
@tamalsaha
tamalsaha deleted the arnob-dbver-expand branch July 12, 2026 15:45
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