mirror of
https://github.com/truenas/charts.git
synced 2026-06-18 01:26:53 +08:00
ixChartContext -> defaults
This commit is contained in:
@@ -22,7 +22,7 @@ tests:
|
||||
mountPath: /somepath
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: A storageClassName must be defined in global.ixChartContext.storageClassName
|
||||
errorMessage: A storageClassName must be defined in global.defaults.storageClassName
|
||||
|
||||
- it: should fail with invalid accessMode
|
||||
set:
|
||||
@@ -568,7 +568,7 @@ tests:
|
||||
documentIndex: *pvcDoc
|
||||
set:
|
||||
global:
|
||||
ixChartContext:
|
||||
defaults:
|
||||
defaultPVCRetain: true
|
||||
persistence:
|
||||
vol1:
|
||||
@@ -589,7 +589,7 @@ tests:
|
||||
documentIndex: *pvcDoc
|
||||
set:
|
||||
global:
|
||||
ixChartContext:
|
||||
defaults:
|
||||
defaultPVCRetain: true
|
||||
persistence:
|
||||
vol1:
|
||||
@@ -610,7 +610,7 @@ tests:
|
||||
documentIndex: *pvcDoc
|
||||
set:
|
||||
global:
|
||||
ixChartContext:
|
||||
defaults:
|
||||
defaultPVCRetain: false
|
||||
persistence:
|
||||
vol1:
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
{{- define "ix.v1.common.class.pvc" -}}
|
||||
{{- $pvcValues := .pvc -}}
|
||||
{{- $root := .root -}}
|
||||
{{- $defaultSize := $root.Values.global.ixChartContext.defaultPVCSize -}}
|
||||
{{- $defaultAccessMode := $root.Values.global.ixChartContext.defaultAccessMode -}}
|
||||
{{- $defaultRetain := $root.Values.global.ixChartContext.defaultPVCRetain -}}
|
||||
{{- $defaultSize := $root.Values.global.defaults.defaultPVCSize -}}
|
||||
{{- $defaultAccessMode := $root.Values.global.defaults.defaultAccessMode -}}
|
||||
{{- $defaultRetain := $root.Values.global.defaults.defaultPVCRetain -}}
|
||||
|
||||
{{- $pvcName := include "ix.v1.common.names.fullname" $root -}}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- define "ix.v1.common.class.service" -}}
|
||||
{{- $svcValues := .svc -}}
|
||||
{{- $root := .root -}}
|
||||
{{- $defaultServiceType := $root.Values.global.ixChartContext.defaultServiceType -}}
|
||||
{{- $defaultServiceType := $root.Values.global.defaults.defaultServiceType -}}
|
||||
{{- $svcName := include "ix.v1.common.names.fullname" $root -}}
|
||||
|
||||
{{- if and (hasKey $svcValues "nameOverride") $svcValues.nameOverride -}}
|
||||
|
||||
@@ -7,7 +7,7 @@ you can specify a size for memory backed volumes.
|
||||
{{/* Volumes included by the controller. */}}
|
||||
{{- define "ix.v1.common.controller.volumes" -}}
|
||||
{{- $root := . -}}
|
||||
{{- $persistenceDefault := .Values.global.ixChartContext.defaultPersistenceType -}}
|
||||
{{- $persistenceDefault := .Values.global.defaults.defaultPersistenceType -}}
|
||||
{{- range $index, $persistence := .Values.persistence -}}
|
||||
{{- if $persistence.enabled -}}
|
||||
{{- if not $persistence.type -}} {{/* If persistence type is not defined, fallback to $persistenceDefault */}}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
{{/*
|
||||
If a storage class is defined on a persistence object:
|
||||
"-" returns "", which means requesting a PV without class
|
||||
SCALE-ZFS returns the value set on Values.global.ixChartContext.storageClassName
|
||||
SCALE-ZFS returns the value set on Values.global.defaults.storageClassName
|
||||
else return the defined storageClass
|
||||
Else if there is a storageClass defined in Values.global.ixChartContext.storageClassName, return this
|
||||
Else if there is a storageClass defined in Values.global.defaults.storageClassName, return this
|
||||
In any other case, return nothing
|
||||
*/}}
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
{{- if eq "-" $className -}}
|
||||
{{- print "\"\"" -}}
|
||||
{{- else if eq "SCALE-ZFS" $className -}}
|
||||
{{- if not $root.Values.global.ixChartContext.storageClassName -}}
|
||||
{{- fail "A storageClassName must be defined in global.ixChartContext.storageClassName" -}}
|
||||
{{- if not $root.Values.global.defaults.storageClassName -}}
|
||||
{{- fail "A storageClassName must be defined in global.defaults.storageClassName" -}}
|
||||
{{- end -}}
|
||||
{{- print $root.Values.global.ixChartContext.storageClassName -}}
|
||||
{{- print $root.Values.global.defaults.storageClassName -}}
|
||||
{{- else -}}
|
||||
{{- print $className -}}
|
||||
{{- end -}}
|
||||
{{- else if $root.Values.global.ixChartContext.storageClassName -}}
|
||||
{{- print $root.Values.global.ixChartContext.storageClassName -}}
|
||||
{{- else if $root.Values.global.defaults.storageClassName -}}
|
||||
{{- print $root.Values.global.defaults.storageClassName -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{/* Renders the PVC objects */}}
|
||||
{{- define "ix.v1.common.spawner.pvc" -}}
|
||||
{{- $defaultType := .Values.global.ixChartContext.defaultPersistenceType -}}
|
||||
{{- $defaultType := .Values.global.defaults.defaultPersistenceType -}}
|
||||
{{- range $name, $pvc := .Values.persistence -}}
|
||||
{{- if and $pvc.enabled (eq (default $defaultType $pvc.type) "pvc") (not ($pvc.existingClaim)) -}}
|
||||
{{- $pvcValues := $pvc -}}
|
||||
|
||||
@@ -69,7 +69,7 @@ stdin: false
|
||||
# Everything bellow needs documentation
|
||||
|
||||
global:
|
||||
ixChartContext:
|
||||
defaults:
|
||||
# If no serviceType is defined, assume this
|
||||
defaultServiceType: ClusterIP
|
||||
# If no PVC Size is defined, assume this
|
||||
|
||||
Reference in New Issue
Block a user