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
cea74cc6
Commit
cea74cc6
authored
Jan 28, 2021
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to retrieve host path from user input or ix volumes
parent
1b0c2107
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
library/common/templates/lib/storage/_ixvolumes.tpl
library/common/templates/lib/storage/_ixvolumes.tpl
+23
-1
No files found.
library/common/templates/lib/storage/_ixvolumes.tpl
View file @
cea74cc6
{{
/*
{{
/*
Retrieve
host
path
from
ix
volumes
based
on
dataset
name
Retrieve
host
path
from
ix
volumes
based
on
dataset
name
*/
}}
*/
}}
{{- define "retrieveHostPathFromiXVolume" -}}
{{- define "
common.
retrieveHostPathFromiXVolume" -}}
{{- range $index, $hostPathConfiguration := $.ixVolumes }}
{{- range $index, $hostPathConfiguration := $.ixVolumes }}
{{- $dsName := base $hostPathConfiguration.hostPath -}}
{{- $dsName := base $hostPathConfiguration.hostPath -}}
{{- if eq $.datasetName $dsName -}}
{{- if eq $.datasetName $dsName -}}
...
@@ -9,3 +9,25 @@ Retrieve host path from ix volumes based on dataset name
...
@@ -9,3 +9,25 @@ Retrieve host path from ix volumes based on dataset name
{{- end -}}
{{- end -}}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{
{
/*
Retrieve
host
path
from
ix
volumes
based
on
a
key
*/
}
}
{{- define "common.configuredHostPath" -}}
{{- $values := . -}}
{{- if and (hasKey $values "hostPathEnabled") (hasKey $values "pathField") -}}
{{- end -}}
{{- if $values.hostPathEnabled -}}
{{- if hasKey $values "pathField" -}}
{{- $values.pathField -}}
{{- else -}}
{{- fail "Path must be specified when host path is enabled" -}}
{{- end -}}
{{- else if and (hasKey $values "datasetName") (hasKey $values "ixVolumes") -}}
{{- $volDict := dict "datasetName" $values.datasetName "ixVolumes" $values.ixVolumes -}}
{{- include "common.retrieveHostPathFromiXVolume" $volDict -}}
{{- else -}}
{{- fail "Dataset name and ix volumes must be specified" -}}
{{- 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