Skip to content

Commit

Permalink
Fix comma-separated medium types parsing in Helm chart
Browse files Browse the repository at this point in the history
This resolves #11778

pr-link: #11786
change-id: cid-41a2e561369e94e2c4d8675c882b9ca8189f2580
  • Loading branch information
jiacheliu3 committed Jul 20, 2020
1 parent a892118 commit 16daf4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions integration/kubernetes/helm-chart/alluxio/CHANGELOG.md
Expand Up @@ -123,3 +123,7 @@

- Add environment variables to master, worker, fuse

0.6.8

- Fixed parsing issue with multiple medium types for tiered storage #11778

2 changes: 1 addition & 1 deletion integration/kubernetes/helm-chart/alluxio/Chart.yaml
Expand Up @@ -12,7 +12,7 @@
name: alluxio
apiVersion: v1
description: Open source data orchestration for analytics and machine learning in any cloud.
version: 0.6.7
version: 0.6.8
home: https://www.alluxio.io/
maintainers:
- name: Adit Madan
Expand Down
18 changes: 9 additions & 9 deletions integration/kubernetes/helm-chart/alluxio/templates/_helpers.tpl
Expand Up @@ -166,11 +166,11 @@ resources:
{{- if contains "," .mediumtype }}
{{- $type := .type }}
{{- $path := .path }}
{{- $split := split "," .mediumtype }}
{{- range $key, $val := $split }}
{{- $parts := splitList "," .mediumtype }}
{{- range $i, $val := $parts }}
{{- /* Example: For path="/tmp/mem,/tmp/ssd", mountPath resolves to /tmp/mem and /tmp/ssd */}}
- mountPath: {{ index ($path | split ",") $key }}
name: {{ $val | lower }}-{{ replace $key "_" "" }}
- mountPath: {{ index ($path | splitList ",") $i }}
name: {{ $val | lower }}-{{ $i }}
{{- end}}
{{- /* The mediumtype is a single value. */}}
{{- else}}
Expand All @@ -195,24 +195,24 @@ resources:
{{- if .mediumtype }}
{{- /* The mediumtype can have multiple parts like MEM,SSD */}}
{{- if contains "," .mediumtype }}
{{- $split := split "," .mediumtype }}
{{- $parts := splitList "," .mediumtype }}
{{- $type := .type }}
{{- $path := .path }}
{{- $volumeName := .name }}
{{- /* A volume will be generated for each part */}}
{{- range $key, $val := $split }}
{{- range $i, $val := $parts }}
{{- /* Example: For mediumtype="MEM,SSD", mediumName resolves to mem-0 and ssd-1 */}}
{{- $mediumName := printf "%v-%v" (lower $val) (replace $key "_" "") }}
{{- $mediumName := printf "%v-%v" (lower $val) $i }}
{{- if eq $type "hostPath"}}
- hostPath:
path: {{ index ($path | split ",") $key }}
path: {{ index ($path | splitList ",") $i }}
type: DirectoryOrCreate
name: {{ $mediumName }}
{{- else if eq $type "persistentVolumeClaim" }}
- name: {{ $mediumName }}
persistentVolumeClaim:
{{- /* Example: For volumeName="/tmp/mem,/tmp/ssd", claimName resolves to /tmp/mem and /tmp/ssd */}}
claimName: {{ index ($volumeName | split ",") $key }}
claimName: {{ index ($volumeName | splitList ",") $i }}
{{- else }}
- name: {{ $mediumName }}
emptyDir:
Expand Down

0 comments on commit 16daf4b

Please sign in to comment.