Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
502e7001
Commit
502e7001
authored
Feb 02, 2021
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to render all volumes/env variables
parent
88bda7e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
library/common/2101.0.0/templates/lib/containers/_environment.tpl
...common/2101.0.0/templates/lib/containers/_environment.tpl
+11
-0
library/common/2101.0.0/templates/lib/storage/_appStorage.tpl
...ary/common/2101.0.0/templates/lib/storage/_appStorage.tpl
+33
-6
No files found.
library/common/2101.0.0/templates/lib/containers/_environment.tpl
View file @
502e7001
...
@@ -28,3 +28,14 @@ Render environment variables
...
@@ -28,3 +28,14 @@ Render environment variables
{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}}
{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{
{
/*
Render
environment
variables
if
present
*/
}
}
{{- define "common.containers.allEnvironmentVariables" -}}
{{- $values := . -}}
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}}
{{- if $values.environmentVariables -}}
env: {{- include "common.containers.environmentVariables" $values | nindent 2 -}}
{{- end -}}
{{- end -}}
library/common/2101.0.0/templates/lib/storage/_appStorage.tpl
View file @
502e7001
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
Define
appVolumeMounts
for
container
Define
appVolumeMounts
for
container
*/
}}
*/
}}
{{- define "common.storage.configureAppVolumeMountsInContainer" -}}
{{- define "common.storage.configureAppVolumeMountsInContainer" -}}
{{- if and .Values.appVolumesEnabled .Values.appVolumeMounts }}
{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}}
{{- range $name, $avm := .Values.appVolumeMounts -}}
{{- $appVolumeMounts := .appVolumeMounts -}}
{{- if $appVolumeMounts }}
{{- range $name, $avm := $appVolumeMounts -}}
{{- if (default true $avm.enabled) }}
{{- if (default true $avm.enabled) }}
{{- if $avm.containerNameOverride -}}
{{- if $avm.containerNameOverride -}}
{{- $name = $avm.containerNameOverride -}}
{{- $name = $avm.containerNameOverride -}}
...
@@ -23,19 +25,22 @@ Define appVolumeMounts for container
...
@@ -23,19 +25,22 @@ Define appVolumeMounts for container
Define
hostPath
for
appVolumes
Define
hostPath
for
appVolumes
*/
}
}
*/
}
}
{{- define "common.storage.configureAppVolumes" -}}
{{- define "common.storage.configureAppVolumes" -}}
{{- if .Values.appVolumeMounts }}
{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}}
{{- range $name, $av := .Values.appVolumeMounts -}}
{{- $appVolumeMounts := .appVolumeMounts -}}
{{- if $appVolumeMounts }}
{{- range $name, $av := $appVolumeMounts -}}
{{- if (default true $av.enabled) }}
{{- if (default true $av.enabled) }}
- name: {{ $name }}
- name: {{ $name }}
{{- if or $av.emptyDir $.
Values.
emptyDirVolumes }}
{{- if or $av.emptyDir $.emptyDirVolumes }}
emptyDir: {}
emptyDir: {}
{{- else }}
{{- else }}
hostPath:
hostPath:
{{ if $av.hostPathEnabled }}
{{ if $av.hostPathEnabled }}
path: {{ required "hostPath not set" $av.hostPath }}
path: {{ required "hostPath not set" $av.hostPath }}
{{- else }}
{{- else }}
{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "ixVolumes")) -}}
{{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}}
{{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}}
{{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $.
Values.
ixVolumes -}}
{{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $.ixVolumes -}}
path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }}
path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
...
@@ -43,3 +48,25 @@ Define hostPath for appVolumes
...
@@ -43,3 +48,25 @@ Define hostPath for appVolumes
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{
{
/*
Get
all
volumes
configuration
*/
}
}
{{- define "common.storage.allAppVolumes" -}}
{{- $appVolumeMounts := .appVolumeMounts -}}
{{- if $appVolumeMounts -}}
volumes: {{- include "common.storage.configureAppVolumes" . | nindent 2 -}}
{{- end -}}
{{- end -}}
{
{
/*
Get
all
container
volume
moutns
configuration
*/
}
}
{{- define "common.storage.allContainerVolumeMounts" -}}
{{- $appVolumeMounts := .appVolumeMounts -}}
{{- if $appVolumeMounts -}}
volumeMounts: {{- include "common.storage.configureAppVolumeMountsInContainer" . | nindent 2 -}}
{{- end -}}
{{- end -}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment