Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion helm/kagent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ Bundled PostgreSQL image - constructs the full image reference from registry/rep
*/}}
{{- define "kagent.postgresql.image" -}}
{{- $pg := .Values.database.postgres.bundled -}}
{{- printf "%s/%s/%s:%s" $pg.image.registry $pg.image.repository $pg.image.name $pg.image.tag -}}
{{- $parts := compact (list $pg.image.registry $pg.image.repository $pg.image.name) -}}
{{- printf "%s:%s" (join "/" $parts) $pg.image.tag -}}
Comment thread
michaelspinks marked this conversation as resolved.
{{- end -}}

{{/*
Expand Down
20 changes: 20 additions & 0 deletions helm/kagent/tests/postgresql_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ tests:
path: spec.template.spec.containers[0].image
value: my-registry.example.com/myorg/postgres:15

- it: should omit empty repository segment in image
template: postgresql.yaml
documentIndex: 2
set:
database:
postgres:
bundled:
image:
registry: docker.io
repository: ""
name: postgres
tag: "18.3-alpine"
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: docker.io/postgres:18.3-alpine
- notMatchRegex:
path: spec.template.spec.containers[0].image
pattern: "//"

- it: should read POSTGRES_PASSWORD from chart-managed secret
template: postgresql.yaml
documentIndex: 2
Expand Down
Loading