Skip to content

Commit

Permalink
Improve labels for volumeClaimTemplates to allow char upgrade (#34)
Browse files Browse the repository at this point in the history
* Improve labels for volumeClaimTemplates to allow char upgrade

* Add chart name into volumeClaimTemplate
  • Loading branch information
Svetomir Smiljkovic authored Aug 26, 2020
1 parent 9b55af2 commit 78a1034
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/bee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
appVersion: latest
name: bee
version: 0.5.2
version: 0.5.3
description: Ethereum Swarm Bee Helm chart for Kubernetes
home: https://swarm.ethereum.org
icon: https://swarm-guide.readthedocs.io/en/latest/_images/swarm.png
Expand Down
20 changes: 20 additions & 0 deletions charts/bee/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}


{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "bee.chartVCT" -}}
{{- printf "%s" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels for volumeClaimTemplates
*/}}
{{- define "bee.labelsVCT" -}}
helm.sh/chart: {{ include "bee.chartVCT" . }}
{{ include "bee.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/bee/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ spec:
- metadata:
name: data
labels:
{{- include "bee.labels" . | nindent 8 }}
{{- include "bee.labelsVCT" . | nindent 8 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
Expand Down

0 comments on commit 78a1034

Please sign in to comment.