not create pvc if existing claim is set

This commit is contained in:
Stavros kois
2023-02-08 15:10:16 +02:00
parent c0c2bf90cd
commit 6a39752d56
2 changed files with 12 additions and 1 deletions
@@ -35,6 +35,17 @@ tests:
isNull:
path: spec.storageClassName
- it: should not create pvc when existingClaim is set
set:
persistence:
my-volume1:
enabled: true
type: pvc
existingClaim: some-existing-claim
asserts:
- hasDocuments:
of: 0
- it: should create pvc with accessModes set as string
set:
some_mode: ReadWriteMany
@@ -18,7 +18,7 @@
{{- include "ix.v1.common.lib.persistence.validation" (dict "rootCtx" $ "objectData" $objectData) -}}
{{/* Only spawn PVC if it's enabled and type of "pvc" */}}
{{- if eq "pvc" $objectData.type -}}
{{- if and (eq "pvc" $objectData.type) (not $objectData.existingClaim) -}}
{{- $objectName := (printf "%s-%s" (include "ix.v1.common.lib.chart.names.fullname" $) $name) -}}
{{/* Perform validations */}}