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
13 changes: 13 additions & 0 deletions helm/kagent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,16 @@ A2A Base URL - computes the default URL based on the controller service name if
{{- printf "http://%s-controller.%s.svc.cluster.local:%d" (include "kagent.fullname" .) (include "kagent.namespace" .) (.Values.controller.service.ports.port | int) -}}
{{- end -}}
{{- end -}}

{{/*
imagePullSecrets from global values (for subchart usage).
Reads .Values.global.imagePullSecrets set by the parent chart.
*/}}
{{- define "kagent.imagePullSecrets" -}}
{{- $global := ((.Values.global).imagePullSecrets) | default list -}}
{{- if $global -}}
imagePullSecrets:
{{- toYaml $global | nindent 2 }}
{{- end -}}
{{- end -}}

1 change: 1 addition & 0 deletions helm/kagent/templates/postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
{{- include "kagent.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: database
spec:
{{- include "kagent.imagePullSecrets" $ | nindent 6 }}
serviceAccountName: {{ $fullname }}
securityContext:
fsGroup: 999
Expand Down
25 changes: 25 additions & 0 deletions helm/kagent/tests/postgresql_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,28 @@ tests:
- hasDocuments:
count: 1

- it: should not render imagePullSecret by default
template: postgresql.yaml
documentIndex: 2
asserts:
- isKind:
of: Deployment
- notExists:
path: spec.template.spec.imagePullSecrets

- it: should render imagePullSecret when available
template: postgresql.yaml
documentIndex: 2
set:
global.imagePullSecrets:
- name: secret1
- name: secret2
asserts:
- isKind:
of: Deployment
- equal:
path: spec.template.spec.imagePullSecrets
value:
- name: secret1
- name: secret2

Loading