Skip to content

Commit

Permalink
Merge pull request #36 from harness/feat/SMP-1854
Browse files Browse the repository at this point in the history
feat: [SMP-1854]: add common.storage.class helper
  • Loading branch information
sean-harness authored Aug 22, 2023
2 parents ad9e843 + 83ab757 commit 27545c7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.27
version: 1.0.28

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
18 changes: 18 additions & 0 deletions src/common/templates/_storage.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- define "harnesscommon.storage.class" -}}

{{- $storageClass := .persistence.storageClass -}}
{{- if .global -}}
{{- if .global.storageClass -}}
{{- $storageClass = .global.storageClass -}}
{{- end -}}
{{- end -}}

{{- if $storageClass -}}
{{- if (eq "-" $storageClass) -}}
{{- printf "storageClassName: \"\"" -}}
{{- else }}
{{- printf "storageClassName: %s" $storageClass -}}
{{- end -}}
{{- end -}}

{{- end -}}

0 comments on commit 27545c7

Please sign in to comment.