Skip to content
Open
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
54 changes: 0 additions & 54 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- $podVolumes := include "kagent.podVolumes" . }}
{{- if $podVolumes }}
volumes:
{{- $podVolumes | nindent 2 }}
{{- end }}
{{- end }}

{{/*
Expand All @@ -243,52 +238,3 @@ volumeMounts:
subPath: keys
{{- end }}
{{- end }}

{{/*
Pod volumes for non-StatefulSet workloads
*/}}
{{- define "kagent.podVolumes" -}}
{{- if ne .Values.deploymentType "statefulset" }}
{{- /* Data volume configuration */ -}}
{{- if .Values.persistence.enabled }}
{{- if eq .Values.persistence.type "hostPath" }}
- name: data
hostPath:
path: {{ .Values.persistence.hostPath.path }}
type: {{ .Values.persistence.hostPath.type | default "DirectoryOrCreate" }}
{{- else if eq .Values.persistence.type "pvc" }}
- name: data
persistentVolumeClaim:
claimName: {{ include "kagent.fullname" . }}-data
{{- else }}
- name: data
emptyDir: {}
{{- end }}
{{- else }}
- name: data
emptyDir: {}
{{- end }}
{{- /* Keypair volume configuration */ -}}
{{- if .Values.persistence.keypair.enabled }}
{{- if eq .Values.persistence.keypair.type "secret" }}
- name: keypair-secret
secret:
{{/* Bind first key from Secret as keys volume*/}}
secretName: {{ include "kagent.fullname" . }}-0-secret
defaultMode: 0400
{{- else if eq .Values.persistence.keypair.type "hostPath" }}
- name: keys
hostPath:
path: {{ .Values.persistence.keypair.hostPath.path }}
type: {{ .Values.persistence.keypair.hostPath.type | default "DirectoryOrCreate" }}
{{- else if eq .Values.persistence.keypair.type "pvc" }}
- name: keys
persistentVolumeClaim:
claimName: {{ include "kagent.fullname" . }}-keys
{{- else }}
- name: keys
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,32 @@ spec:
{{- include "kagent.selectorLabels" . | nindent 8 }}
spec:
{{- include "kagent.podSpec" . | nindent 6 }}
volumes:
{{- if .Values.persistence.enabled }}
{{- if eq .Values.persistence.type "hostPath" }}
- name: data
hostPath:
path: {{ .Values.persistence.hostPath.path }}
Comment on lines +23 to +28

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new DaemonSet volumes rendering logic is not covered by the existing Helm unit tests (current tests/daemonset_test.yaml focuses on probes/env). Please add assertions that validate the rendered spec.template.spec.volumes entries for both persistence.type (hostPath vs emptyDir) and keypair volume behavior, so regressions in volume naming/types are caught.

Copilot uses AI. Check for mistakes.
type: {{ .Values.persistence.hostPath.type | default "DirectoryOrCreate" }}
{{- else }}
- name: data
emptyDir: {}
{{- end }}
{{- else }}
- name: data
emptyDir: {}
{{- end }}
{{- /* Keypair volume configuration */ -}}
{{- if .Values.persistence.keypair.enabled }}
{{- if eq .Values.persistence.keypair.type "hostPath" }}
- name: keys
hostPath:
path: {{ .Values.persistence.keypair.hostPath.path }}
type: {{ .Values.persistence.keypair.hostPath.type | default "DirectoryOrCreate" }}
{{- else }}
- name: keys
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}

Loading