From 49a08334e04e627ad59602172b8c12d40377811f Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 28 Jan 2021 22:31:35 +0500 Subject: [PATCH] Add common implementation for networking/storage --- library/common/templates/lib/networking/_dns.tpl | 10 ++++++++++ library/common/templates/lib/storage/_ixvolumes.tpl | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 library/common/templates/lib/networking/_dns.tpl create mode 100644 library/common/templates/lib/storage/_ixvolumes.tpl diff --git a/library/common/templates/lib/networking/_dns.tpl b/library/common/templates/lib/networking/_dns.tpl new file mode 100644 index 0000000000..79a1a325d1 --- /dev/null +++ b/library/common/templates/lib/networking/_dns.tpl @@ -0,0 +1,10 @@ +{{/* +DNS Configuration +*/}} +{{- define "dnsConfiguration" }} +dnsPolicy: {{ .Values.dnsPolicy }} +{{- if .Values.dnsConfig }} +dnsConfig: + {{- toYaml .Values.dnsConfig | nindent 2 }} +{{- end }} +{{- end }} diff --git a/library/common/templates/lib/storage/_ixvolumes.tpl b/library/common/templates/lib/storage/_ixvolumes.tpl new file mode 100644 index 0000000000..8982c1b5a4 --- /dev/null +++ b/library/common/templates/lib/storage/_ixvolumes.tpl @@ -0,0 +1,11 @@ +{{/* +Retrieve host path from ix volumes based on dataset name +*/}} +{{- define "retrieveHostPathFromiXVolume" -}} +{{- range $index, $hostPathConfiguration := $.ixVolumes }} +{{- $dsName := base $hostPathConfiguration.hostPath -}} +{{- if eq $.datasetName $dsName -}} +{{- $hostPathConfiguration.hostPath -}} +{{- end -}} +{{- end }} +{{- end -}}