Skip to content

Commit

Permalink
feat: add support for common labels in helm charts (#51)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
electrosenpai and cbuto authored Nov 28, 2022
1 parent 0d01731 commit 9d033eb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/chartmuseum/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: Host your own Helm Chart Repository
name: chartmuseum
version: 3.9.1
version: 3.9.2
appVersion: 0.15.0
home: https://github.com/helm/chartmuseum
icon: https://raw.githubusercontent.com/chartmuseum/charts/main/logo.jpg
Expand Down
3 changes: 3 additions & 0 deletions src/chartmuseum/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ helm.sh/chart: {{ include "chartmuseum.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{- if .Values.commonLabels}}
{{ toYaml .Values.commonLabels }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

Expand Down
1 change: 1 addition & 0 deletions src/chartmuseum/templates/pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: PersistentVolume
metadata:
name: {{ .Values.persistence.pv.pvname | default (include "chartmuseum.fullname" .) }}
labels:
{{- include "chartmuseum.labels" . | nindent 4 }}
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}
spec:
capacity:
Expand Down
1 change: 1 addition & 0 deletions src/chartmuseum/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: v1
metadata:
name: {{ include "chartmuseum.fullname" . }}
labels:
{{- include "chartmuseum.labels" . | nindent 4 }}
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}
{{- with .Values.persistence.labels }}
{{- toYaml . | nindent 4 }}
Expand Down
4 changes: 4 additions & 0 deletions src/chartmuseum/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ image:
pullPolicy: IfNotPresent
secret:
labels: {}
## Labels to apply to all resources
##
commonLabels: {}
# team_name: dev
env:
open:
# storage backend, can be one of: local, alibaba, amazon, google, microsoft, oracle
Expand Down

0 comments on commit 9d033eb

Please sign in to comment.