浏览代码

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 -}}