diff --git a/library/common-test/tests/pvc/pvc_test.yaml b/library/common-test/tests/pvc/pvc_test.yaml index a0083c78da..e5aef41669 100644 --- a/library/common-test/tests/pvc/pvc_test.yaml +++ b/library/common-test/tests/pvc/pvc_test.yaml @@ -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: diff --git a/library/common/1.0.0/templates/class/_pvc.tpl b/library/common/1.0.0/templates/class/_pvc.tpl index a97dc33fde..bfa315ffed 100644 --- a/library/common/1.0.0/templates/class/_pvc.tpl +++ b/library/common/1.0.0/templates/class/_pvc.tpl @@ -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 -}} diff --git a/library/common/1.0.0/templates/class/_service.tpl b/library/common/1.0.0/templates/class/_service.tpl index 709b70068a..befceca9ca 100644 --- a/library/common/1.0.0/templates/class/_service.tpl +++ b/library/common/1.0.0/templates/class/_service.tpl @@ -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 -}} diff --git a/library/common/1.0.0/templates/lib/controller/_volumes.tpl b/library/common/1.0.0/templates/lib/controller/_volumes.tpl index b35f5475b7..1ed226ba9b 100644 --- a/library/common/1.0.0/templates/lib/controller/_volumes.tpl +++ b/library/common/1.0.0/templates/lib/controller/_volumes.tpl @@ -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 */}} diff --git a/library/common/1.0.0/templates/lib/util/_storageClassName.tpl b/library/common/1.0.0/templates/lib/util/_storageClassName.tpl index c5e5a289ca..77412cec8c 100644 --- a/library/common/1.0.0/templates/lib/util/_storageClassName.tpl +++ b/library/common/1.0.0/templates/lib/util/_storageClassName.tpl @@ -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 -}} diff --git a/library/common/1.0.0/templates/spawner/_pvc.tpl b/library/common/1.0.0/templates/spawner/_pvc.tpl index f6b54989a0..0c0e7cfc73 100644 --- a/library/common/1.0.0/templates/spawner/_pvc.tpl +++ b/library/common/1.0.0/templates/spawner/_pvc.tpl @@ -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 -}} diff --git a/library/common/1.0.0/values.yaml b/library/common/1.0.0/values.yaml index facb0d2bb4..8438863656 100644 --- a/library/common/1.0.0/values.yaml +++ b/library/common/1.0.0/values.yaml @@ -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