Skip to content

support sharedSecretFiles with other volumes#16

Merged
KantharakornPH merged 1 commit intomainfrom
feature/shared-secret-files-support-volume
Apr 11, 2026
Merged

support sharedSecretFiles with other volumes#16
KantharakornPH merged 1 commit intomainfrom
feature/shared-secret-files-support-volume

Conversation

@PhennyOpsta
Copy link
Copy Markdown

@PhennyOpsta PhennyOpsta commented Apr 11, 2026

Update volumeMounts logic to allow sharedSecretFiles to be used together with other volume configurations.

@KantharakornPH KantharakornPH merged commit 5449569 into main Apr 11, 2026
1 check passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the common chart version to 0.10.0 across several charts and includes minor formatting improvements in the volume mounts template and test files. I have identified a potential issue in the _volumeMountsRef.yaml template where an empty volumeMounts: key could be generated if sharedSecretFiles contains entries with empty file lists; I recommend adding a validation check to prevent this.

Comment on lines 37 to 47
{{- 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 }}
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.

@PhennyOpsta PhennyOpsta deleted the feature/shared-secret-files-support-volume branch April 11, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants