diff --git a/charts/agent/Chart.yaml b/charts/agent/Chart.yaml index 311f6a4dd..173591f4a 100644 --- a/charts/agent/Chart.yaml +++ b/charts/agent/Chart.yaml @@ -30,4 +30,4 @@ sources: - https://app.sysdigcloud.com/#/settings/user - https://github.com/draios/sysdig type: application -version: 1.27.7 +version: 1.27.8 diff --git a/charts/agent/templates/daemonset.yaml b/charts/agent/templates/daemonset.yaml index a836fafa3..590abd39c 100644 --- a/charts/agent/templates/daemonset.yaml +++ b/charts/agent/templates/daemonset.yaml @@ -163,8 +163,8 @@ spec: name: bpf-probes {{- end }} - {{- if and (.Values.kmodule) (.Values.kmodule.extraVolumes) (.Values.kmodule.extraVolumes.mounts) }} - {{ toYaml .Values.kmodule.extraVolumes.mounts | nindent 12 }} + {{- if .Values.daemonset.kmodule.extraVolumes.mounts }} + {{ toYaml .Values.daemonset.kmodule.extraVolumes.mounts | nindent 12 }} {{- end }} {{- end }} containers: @@ -521,8 +521,8 @@ spec: {{ toYaml .Values.extraVolumes.volumes | nindent 8 }} {{- end }} - {{- if and (.Values.kmodule) (.Values.kmodule.extraVolumes) (.Values.kmodule.extraVolumes.volumes) }} - {{ toYaml .Values.kmodule.extraVolumes.volumes | nindent 8 }} + {{- if .Values.daemonset.kmodule.extraVolumes.volumes }} + {{ toYaml .Values.daemonset.kmodule.extraVolumes.volumes | nindent 8 }} {{- end }} updateStrategy: type: {{ .Values.daemonset.updateStrategy.type }} diff --git a/charts/agent/tests/volumes_test.yaml b/charts/agent/tests/volumes_test.yaml index d77fd9e04..9288e00d0 100644 --- a/charts/agent/tests/volumes_test.yaml +++ b/charts/agent/tests/volumes_test.yaml @@ -265,26 +265,51 @@ tests: - it: Check kmodule extra volumes/mounts set: - kmodule: - extraVolumes: - mounts: - - mountPath: /host/usr/lib64 - name: lib64-vol - volumes: - - name: lib64-vol - hostPath: - path: /lib64 + daemonset: + kmodule: + extraVolumes: + mounts: + - mountPath: /host/usr/lib64 + name: lib64-vol + - mountPath: /host/custom + name: custom-vol + volumes: + - name: lib64-vol + hostPath: + path: /lib64 + - name: custom-vol + hostPath: + path: /mnt/custom asserts: - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - mountPath: /host/usr/lib64 - name: lib64-vol - - contains: - path: spec.template.spec.volumes - content: - name: lib64-vol + - equal: + path: spec.template.spec.initContainers[*].volumeMounts[?(@.name == "lib64-vol")].mountPath + value: /host/usr/lib64 + - equal: + path: spec.template.spec.volumes[?(@.name == "lib64-vol")].hostPath + value: + path: /lib64 + - equal: + path: spec.template.spec.initContainers[*].volumeMounts[?(@.name == "custom-vol")].mountPath + value: /host/custom + - equal: + path: spec.template.spec.volumes[?(@.name == "custom-vol")].hostPath + value: + path: /mnt/custom + templates: + - templates/daemonset.yaml + + - it: Check kmodule don't have extra volumes/mounts when we set the extraVolumes + set: + extraVolumes: + mounts: + - mountPath: /host/custom + name: custom-vol + volumes: + - name: custom-vol hostPath: - path: /lib64 + path: /mnt/custom + asserts: + - isNull: + path: spec.template.spec.initContainers[*].volumeMounts[?(@.name == "custom-vol")] templates: - templates/daemonset.yaml