mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 06:59:20 -03:00
fix SFS volumeMounts
This commit is contained in:
@@ -11,15 +11,28 @@ tests:
|
||||
my-volume1:
|
||||
enabled: true
|
||||
type: vct
|
||||
mountPath: /some/path1
|
||||
my-volume2:
|
||||
enabled: true
|
||||
type: vct
|
||||
mountPath: /some/path2
|
||||
workload:
|
||||
main:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: StatefulSet
|
||||
podSpec: {}
|
||||
podSpec:
|
||||
containers:
|
||||
main:
|
||||
enabled: true
|
||||
primary: true
|
||||
probes:
|
||||
liveness:
|
||||
enabled: false
|
||||
readiness:
|
||||
enabled: false
|
||||
startup:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: &statefulSetDoc 0
|
||||
isKind:
|
||||
@@ -31,7 +44,15 @@ tests:
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].metadata.name
|
||||
value: test-release-name-common-test-my-volume1
|
||||
- documentIndex: *statefulSetDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[1].name
|
||||
value: test-release-name-common-test-my-volume1
|
||||
- documentIndex: *statefulSetDoc
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[1].metadata.name
|
||||
value: test-release-name-common-test-my-volume2
|
||||
- documentIndex: *statefulSetDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[2].name
|
||||
value: test-release-name-common-test-my-volume2
|
||||
|
||||
@@ -22,7 +22,9 @@ objectData: The object data to be used to render the container.
|
||||
{{- if and (eq $enabled "true") (not (and (eq $persistenceValues.type "vct") (ne $objectData.podType "StatefulSet"))) -}}
|
||||
{{/* Dont try to mount configmap/sercet/vct to codeserver */}}
|
||||
{{- if not (and (eq $objectData.shortName "codeserver") (mustHas $persistenceValues.type $codeServerIgnoredTypes)) -}}
|
||||
{{- $volMount := (fromJson (include "tc.v1.common.lib.container.volumeMount.isSelected" (dict "persistenceName" $persistenceName "persistenceValues" $persistenceValues "objectData" $objectData))) -}}
|
||||
{{- $volMount := (include "tc.v1.common.lib.container.volumeMount.isSelected" (dict
|
||||
"rootCtx" $rootCtx "persistenceName" $persistenceName "persistenceValues" $persistenceValues "objectData" $objectData
|
||||
)) | fromJson -}}
|
||||
{{- if $volMount -}}
|
||||
{{- $volMounts = mustAppend $volMounts $volMount -}}
|
||||
{{- end -}}
|
||||
@@ -69,9 +71,14 @@ objectData: The object data to be used to render the container.
|
||||
{{- $persistenceName := .persistenceName -}}
|
||||
{{- $persistenceValues := .persistenceValues -}}
|
||||
{{- $objectData := .objectData -}}
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
|
||||
{{/* Initialize from the default values */}}
|
||||
{{- $volMount := dict -}}
|
||||
{{- if eq $objectData.podType "StatefulSet" -}}
|
||||
{{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $rootCtx -}}
|
||||
{{- $persistenceName = printf "%s-%s" $fullname $persistenceName -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $volMount "name" $persistenceName -}}
|
||||
{{- if eq $persistenceValues.type "device" -}} {{/* On devices use the hostPath as default if mountpath is not defined */}}
|
||||
{{- $_ := set $volMount "mountPath" ($persistenceValues.mountPath | default $persistenceValues.hostPath | default "") -}}
|
||||
|
||||
Reference in New Issue
Block a user