fixes 2 Andrea Pulvirenti <an.pulvy@gmail.com>
This commit is contained in:
parent
53a4ad4c4b
commit
0dd0a93ce1
|
|
@ -146,7 +146,7 @@ Params:
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "common.configmap.lookup" -}}
|
{{- define "common.configmap.lookup" -}}
|
||||||
{{- $value := "" -}}
|
{{- $value := "" -}}
|
||||||
{{- $configmapData := (lookup "v1" "ConfigMap" (include "common.names.namespace" .context) (index . "config")).data -}}
|
{{- $configmapData := (lookup "v1" "ConfigMap" .context.Values.nfs.existingConfigMap.namespace .config).data -}}
|
||||||
{{- if and $configmapData (hasKey $configmapData .key) -}}
|
{{- if and $configmapData (hasKey $configmapData .key) -}}
|
||||||
{{- $value = index $configmapData .key -}}
|
{{- $value = index $configmapData .key -}}
|
||||||
{{- else if .defaultValue -}}
|
{{- else if .defaultValue -}}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
{{- $server := .Values.nfs.server | default "127.0.0.1" -}}
|
||||||
{{ if (include "nfs.existing-configmap-provided" .) }}
|
{{ if (include "nfs.existing-configmap-provided" .) }}
|
||||||
{{- $existingConfigMap := (lookup "v1" "ConfigMap" .Values.nfs.existingConfigMap.namespace .Values.nfs.existingConfigMap.name ).data }}
|
{{- $existingConfigMap := (lookup "v1" "ConfigMap" .Values.nfs.existingConfigMap.namespace .Values.nfs.existingConfigMap.name).data }}
|
||||||
{{- if (not $existingConfigMap) }}
|
{{- if (not $existingConfigMap) }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
path: {{ .Values.nfs.path }}
|
path: {{ .Values.nfs.path }}
|
||||||
server: {{ .Values.nfs.server}}
|
server: {{ $server }}
|
||||||
immutable: false
|
immutable: false
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{{- $server := .Values.nfs.server | default "0.0.0.0" -}}
|
{{- $server := .Values.nfs.server | default "127.0.0.1" -}}
|
||||||
{{- $path := .Values.nfs.path -}}
|
{{- $path := .Values.nfs.path -}}
|
||||||
{{- if (include "nfs.existing-configmap-provided" .) -}}
|
{{- if (include "nfs.existing-configmap-provided" .) -}}
|
||||||
{{- $server := (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "server" "0.0.0.0" .Values.nfs.server "context" $)) -}}
|
{{- $server = (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "server" "defaultValue" "127.0.0.1" "context" $)) -}}
|
||||||
{{- $path := (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "path" "defaultValue" .Values.nfs.path "context" $)) -}}
|
{{- $path = (include "common.configmap.lookup" (dict "config" .Values.nfs.existingConfigMap.name "key" "path" "defaultValue" .Values.nfs.path "context" $)) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|
@ -61,7 +60,7 @@ spec:
|
||||||
- name: PROVISIONER_NAME
|
- name: PROVISIONER_NAME
|
||||||
value: {{ template "nfs-subdir-external-provisioner.provisionerName" . }}
|
value: {{ template "nfs-subdir-external-provisioner.provisionerName" . }}
|
||||||
- name: NFS_SERVER
|
- name: NFS_SERVER
|
||||||
value: {{ $server }}
|
value: {{ $server }}
|
||||||
- name: NFS_PATH
|
- name: NFS_PATH
|
||||||
value: {{ $path }}
|
value: {{ $path }}
|
||||||
{{- if eq .Values.leaderElection.enabled false }}
|
{{- if eq .Values.leaderElection.enabled false }}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ nfs:
|
||||||
reclaimPolicy: Retain
|
reclaimPolicy: Retain
|
||||||
# existing configmap in order to get server and path
|
# existing configmap in order to get server and path
|
||||||
existingConfigMap:
|
existingConfigMap:
|
||||||
name: "oiadp-nfs-config"
|
name: oiadp-nfs-config
|
||||||
namespace: default
|
namespace: default
|
||||||
|
|
||||||
# For creating the StorageClass automatically:
|
# For creating the StorageClass automatically:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue