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
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.0
version: 0.10.0
18 changes: 9 additions & 9 deletions charts/common/templates/_volumeMountsRef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ volumeMounts:
readOnly: true
{{- end }}
{{- range .Values.sharedSecretFiles }}
{{- $secretName := .name }}
{{- range .files }}
- name: {{ $secretName }}
mountPath: {{ .mountPath }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- $secretName := .name }}
{{- range .files }}
- name: {{ $secretName }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- end }}
Comment on lines 37 to 47
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current logic for sharedSecretFiles may produce an invalid volumeMounts: key with no items if sharedSecretFiles is provided as a list containing entries with empty files lists (e.g., sharedSecretFiles: [{name: "foo", files: []}]). This happens because the outer if at line 2 evaluates to true, printing volumeMounts:, but the inner range at line 39 produces no output. Consider adding a check to ensure at least one file is present before printing the volumeMounts: header, or ensure that the schema validation prevents empty files lists.

{{- end }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cron-job/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.9.0
digest: sha256:c691781bff5490003ec6b84de1a1f71ab89d193325e5f5fe1c83b8c1398e2273
generated: "2026-02-09T14:46:51.755970924+07:00"
version: 0.10.0
digest: sha256:c0136a61afbb092681586b926e6d2efcfd1ead7652f1f315deff8b9f437a81f7
generated: "2026-04-11T14:44:03.972159519+07:00"
2 changes: 1 addition & 1 deletion charts/cron-job/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ version: 0.80.0

dependencies:
- name: common
version: 0.9.0
version: 0.10.0
repository: file://../common
Binary file added charts/cron-job/charts/common-0.10.0.tgz
Binary file not shown.
Binary file removed charts/cron-job/charts/common-0.9.0.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions charts/onechart/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.9.0
digest: sha256:c691781bff5490003ec6b84de1a1f71ab89d193325e5f5fe1c83b8c1398e2273
generated: "2026-02-09T14:47:43.892718793+07:00"
version: 0.10.0
digest: sha256:c0136a61afbb092681586b926e6d2efcfd1ead7652f1f315deff8b9f437a81f7
generated: "2026-04-11T14:45:45.109287169+07:00"
2 changes: 1 addition & 1 deletion charts/onechart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ version: 0.80.0

dependencies:
- name: common
version: 0.9.0
version: 0.10.0
repository: file://../common
Binary file added charts/onechart/charts/common-0.10.0.tgz
Binary file not shown.
Binary file removed charts/onechart/charts/common-0.9.0.tgz
Binary file not shown.
100 changes: 86 additions & 14 deletions charts/onechart/tests/deployment_volumes_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ tests:
- name: volume-name
fileName: myfile.conf
fileContent: |
blablabla
bla
blablabla
bla
path: /randomPath/myfile.conf
subPath: myfile.conf
asserts:
Expand All @@ -225,7 +225,7 @@ tests:
- it: Should mount a volume only for the init container
set:
initContainers:
- name : pod
- name: pod
image: debian
tag: v1.0.0
volumes:
Expand All @@ -238,26 +238,26 @@ tests:
equal:
path: spec.template.spec.volumes
value:
- name: init-volume
emptyDir: {}
- name: init-volume
emptyDir: {}
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].volumeMounts
value:
- name: init-volume
mountPath: /data
- name: init-volume
mountPath: /data
- template: deployment.yaml
documentIndex: 0
notEqual:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: init-volume
emptyDir: {}
- name: init-volume
emptyDir: {}
- it: Should mount a shared volume between the main container and the init container
set:
initContainers:
- name : pod
- name: pod
image: debian
tag: v1.0.0
volumes:
Expand All @@ -270,12 +270,84 @@ tests:
equal:
path: spec.template.spec.initContainers[0].volumeMounts
value:
- name: shared-volume
mountPath: /data
- name: shared-volume
mountPath: /data
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: shared-volume
mountPath: /data
- name: shared-volume
mountPath: /data
- it: Should use an existing secret as volume with sharedSecretFiles
set:
sharedSecretFiles:
- name: opsta-secret
files:
- mountPath: /randomPath/app.creds
subPath: app.creds
- mountPath: /randomPath/app.conf
subPath: app.conf
asserts:
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.volumes
value:
- name: opsta-secret
secret:
secretName: opsta-secret
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: opsta-secret
readOnly: true
mountPath: /randomPath/app.creds
subPath: app.creds
- name: opsta-secret
readOnly: true
mountPath: /randomPath/app.conf
subPath: app.conf
- it: Should use sharedSecretFiles and other volumes
set:
sharedSecretFiles:
- name: opsta-secret
files:
- mountPath: /randomPath/app.creds
subPath: app.creds
- mountPath: /randomPath/app.conf
subPath: app.conf
volumes:
- name: opsta-volume
path: /opt/data
size: 20Gi
storageClass: default
asserts:
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.volumes
value:
- name: opsta-volume
persistentVolumeClaim:
claimName: RELEASE-NAME-opsta-volume
- name: opsta-secret
secret:
secretName: opsta-secret
- template: deployment.yaml
documentIndex: 0
equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- mountPath: /opt/data
name: opsta-volume
- name: opsta-secret
readOnly: true
mountPath: /randomPath/app.creds
subPath: app.creds
- name: opsta-secret
readOnly: true
mountPath: /randomPath/app.conf
subPath: app.conf
6 changes: 3 additions & 3 deletions charts/static-site/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.9.0
digest: sha256:c691781bff5490003ec6b84de1a1f71ab89d193325e5f5fe1c83b8c1398e2273
generated: "2026-02-09T15:31:53.899987212+07:00"
version: 0.10.0
digest: sha256:c0136a61afbb092681586b926e6d2efcfd1ead7652f1f315deff8b9f437a81f7
generated: "2026-04-11T14:47:21.751737453+07:00"
2 changes: 1 addition & 1 deletion charts/static-site/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ version: 0.80.0

dependencies:
- name: common
version: 0.9.0
version: 0.10.0
repository: file://../common
Binary file added charts/static-site/charts/common-0.10.0.tgz
Binary file not shown.
Binary file removed charts/static-site/charts/common-0.9.0.tgz
Binary file not shown.
Binary file added common-0.10.0.tgz
Binary file not shown.
Binary file removed common-0.9.0.tgz
Binary file not shown.
Binary file added docs/cron-job-0.80.0.tgz
Binary file not shown.
Loading
Loading