Skip to content

Commit 9d033eb

Browse files
electrosenpaicbuto
andauthored
feat: add support for common labels in helm charts (#51)
* feat: add support for common labels in helm charts Signed-off-by: Jean-Baptiste DONNETTE <[email protected]> * Moving common label inside chartmuseum labels * Update src/chartmuseum/Chart.yaml Co-authored-by: Casey Buto <[email protected]> * Updating pv & pvc to have global labels Signed-off-by: Jean-Baptiste DONNETTE <[email protected]> Co-authored-by: Casey Buto <[email protected]>
1 parent 0d01731 commit 9d033eb

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

src/chartmuseum/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: Host your own Helm Chart Repository
33
name: chartmuseum
4-
version: 3.9.1
4+
version: 3.9.2
55
appVersion: 0.15.0
66
home: https://github.com/helm/chartmuseum
77
icon: https://raw.githubusercontent.com/chartmuseum/charts/main/logo.jpg

src/chartmuseum/templates/_helpers.tpl

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ helm.sh/chart: {{ include "chartmuseum.chart" . }}
4545
{{- if .Chart.AppVersion }}
4646
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4747
{{- end }}
48+
{{- if .Values.commonLabels}}
49+
{{ toYaml .Values.commonLabels }}
50+
{{- end }}
4851
app.kubernetes.io/managed-by: {{ .Release.Service }}
4952
{{- end }}
5053

src/chartmuseum/templates/pv.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kind: PersistentVolume
44
metadata:
55
name: {{ .Values.persistence.pv.pvname | default (include "chartmuseum.fullname" .) }}
66
labels:
7+
{{- include "chartmuseum.labels" . | nindent 4 }}
78
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}
89
spec:
910
capacity:

src/chartmuseum/templates/pvc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ apiVersion: v1
44
metadata:
55
name: {{ include "chartmuseum.fullname" . }}
66
labels:
7+
{{- include "chartmuseum.labels" . | nindent 4 }}
78
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}
89
{{- with .Values.persistence.labels }}
910
{{- toYaml . | nindent 4 }}

src/chartmuseum/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ image:
99
pullPolicy: IfNotPresent
1010
secret:
1111
labels: {}
12+
## Labels to apply to all resources
13+
##
14+
commonLabels: {}
15+
# team_name: dev
1216
env:
1317
open:
1418
# storage backend, can be one of: local, alibaba, amazon, google, microsoft, oracle

0 commit comments

Comments
 (0)