Преглед на файлове

Add method to retrieve single volume configuration based on input

Waqar Ahmed преди 4 години
родител
ревизия
399f867f26
променени са 1 файла, в които са добавени 17 реда и са изтрити 0 реда
  1. 17 0
      library/common/templates/lib/storage/_volume.tpl

+ 17 - 0
library/common/templates/lib/storage/_volume.tpl

@@ -0,0 +1,17 @@
+{{/*
+Retrieve volume configuration
+*/}}
+{{- define "common.volumeConfig" -}}
+{{- $values := . -}}
+{{- if hasKey $values "name" }}
+- name: {{ $values.name }}
+{{- if $values.emptyDirVolumes -}}
+  emptyDir: {}
+{{- else -}}
+  hostPath:
+    path: {{ template "common.configuredHostPath" $values }}
+{{- end -}}
+{{- else -}}
+{{- fail "Name must be specified for Volume Configuration" -}}
+{{- end -}}
+{{- end -}}