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/templates/_pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- define "common.pvc.tpl" -}}
{{- range .Values.volumes }}
{{- if not (or .existingClaim .hostPath .fileName .emptyDir .existingConfigMap) }}
{{- if not (or .existingClaim .hostPath .fileName .emptyDir .existingConfigMap .existingSecret) }}
{{- $robustName := include "common.robustName" $.Release.Name }}
---
apiVersion: v1
Expand Down
9 changes: 9 additions & 0 deletions charts/onechart/tests/pvc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: Should not generate a claim when using existingSecret
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
existingSecret: my-existing-secret
asserts:
- hasDocuments:
count: 0
Comment on lines +49 to +57
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

This test case is a great addition to verify that no PVC is created when existingSecret is used. However, it highlights an inconsistency in values.schema.json.

This test correctly includes the name property for the volume, which is required by the common.volumesRef.tpl template to name the volume mount. However, the schema definition for volumes using existingSecret (under properties.volumes.items.anyOf) is missing this name property. This is also the case for volumes using existingConfigMap.

This discrepancy can lead to validation errors for users. To improve the chart's robustness and user experience, I recommend updating values.schema.json to include the name property in the schema for existingSecret volumes and make it required.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please suggest how to modify values.schema.json?