fixes 1 Andrea Pulvirenti <an.pulvy@gmail.com>
This commit is contained in:
		
							parent
							
								
									1be1e74c8d
								
							
						
					
					
						commit
						53a4ad4c4b
					
				|  | @ -2,7 +2,7 @@ | |||
| {{/*  | ||||
|    Allow namespace to be overriden | ||||
| */}} | ||||
| {{- define "common.name.namespace" -}} | ||||
| {{- define "common.names.namespace" -}} | ||||
| {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}} | ||||
| {{- end -}} | ||||
| 
 | ||||
|  | @ -146,7 +146,7 @@ Params: | |||
| */}} | ||||
| {{- define "common.configmap.lookup" -}} | ||||
| {{- $value := "" -}} | ||||
| {{- $configmapData := (lookup "v1" "ConfigMap" (include "common.names.namespace" .context) .configmapName).data -}} | ||||
| {{- $configmapData := (lookup "v1" "ConfigMap" (include "common.names.namespace" .context) (index . "config")).data -}} | ||||
| {{- if and $configmapData (hasKey $configmapData .key) -}} | ||||
|   {{- $value = index $configmapData .key -}} | ||||
| {{- else if .defaultValue -}} | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| {{ if (include "nfs.existing-configmap-provided" .) }} | ||||
| {{- $existingConfigMap := (lookup "v1" "ConfigMap" .Values.nfs.existingConfigMap.namespace .Values.nfs.existingConfigMap.name).data | default dict }} | ||||
| {{- if not $existingConfigMap }} | ||||
| {{- $existingConfigMap := (lookup "v1" "ConfigMap" .Values.nfs.existingConfigMap.namespace .Values.nfs.existingConfigMap.name ).data }} | ||||
| {{- if (not $existingConfigMap)  }} | ||||
| apiVersion: v1 | ||||
| data: | ||||
|   path: {{ .Values.nfs.path }} | ||||
|  | @ -9,5 +9,7 @@ immutable: false | |||
| kind: ConfigMap | ||||
| metadata: | ||||
|   name: {{ template "nfs.existing-configmap" . }} | ||||
|   annotation:  | ||||
|     helm.sh/hook: pre-install, pre-upgrade | ||||
| {{- end }} | ||||
| {{- end }} | ||||
|  | @ -1,8 +1,7 @@ | |||
| 
 | ||||
| {{- $server := .Values.nfs.server -}} | ||||
| {{- $server := .Values.nfs.server  | default "0.0.0.0" -}} | ||||
| {{- $path := .Values.nfs.path -}} | ||||
| {{- if (include "nfs.existing-configmap-provided" .) -}} | ||||
| {{- $server := (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "server" "defaultValue" .Values.nfs.server "context" $)) -}} | ||||
| {{- $server := (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "server" "0.0.0.0" .Values.nfs.server "context" $)) -}} | ||||
| {{- $path := (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "path" "defaultValue" .Values.nfs.path "context" $)) -}} | ||||
| {{- end -}} | ||||
| 
 | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ nfs: | |||
|   reclaimPolicy: Retain | ||||
|   # existing configmap in order to get server and path | ||||
|   existingConfigMap: | ||||
|     name:  | ||||
|     name: "oiadp-nfs-config" | ||||
|     namespace: default | ||||
| 
 | ||||
| # For creating the StorageClass automatically: | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue