Skip to content

Commit

Permalink
Populate chart labels for all k8s resources (#3943)
Browse files Browse the repository at this point in the history
Signed-off-by: tewfik-ghariani <tewfik.ghariani@1und1.de>
  • Loading branch information
tewfik-ghariani authored Jul 16, 2024
1 parent f65d8ac commit a13901d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/artifact-hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: artifact-hub
description: Artifact Hub is a web-based application that enables finding, installing, and publishing Cloud Native packages.
type: application
version: 1.19.0
version: 1.19.1-0
appVersion: 1.19.0
kubeVersion: ">= 1.19.0-0"
home: https://artifacthub.io
Expand Down
6 changes: 4 additions & 2 deletions charts/artifact-hub/templates/db_migrator_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ metadata:
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
{{- with .Values.dbMigrator.job.extraJobLabels }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- with .Values.dbMigrator.job.extraJobLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: {{ .Values.dbMigrator.job.ttlSecondsAfterFinished }}
template:
{{- with .Values.dbMigrator.job.extraPodLabels }}
metadata:
labels:
{{- include "chart.labels" . | nindent 8 }}
{{- with .Values.dbMigrator.job.extraPodLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/db_migrator_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "chart.resourceNamePrefix" . }}db-migrator-config
labels:
{{- include "chart.labels" . | nindent 4 }}
type: Opaque
stringData:
tern.conf: |-
Expand Down
4 changes: 4 additions & 0 deletions charts/artifact-hub/templates/hub_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "chart.resourceNamePrefix" . }}job-reader
labels:
{{- include "chart.labels" . | nindent 4 }}
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
Expand All @@ -12,6 +14,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "chart.resourceNamePrefix" . }}hub-job-reader
labels:
{{- include "chart.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "chart.resourceNamePrefix" . }}hub
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/hub_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "chart.resourceNamePrefix" . }}hub-config
labels:
{{- include "chart.labels" . | nindent 4 }}
type: Opaque
stringData:
hub.yaml: |-
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/hub_serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "chart.serviceAccountName" . }}
labels:
{{- include "chart.labels" . | nindent 4 }}
automountServiceAccountToken: {{ .Values.hub.serviceAccount.automountServiceAccountToken }}
{{- end }}
6 changes: 4 additions & 2 deletions charts/artifact-hub/templates/scanner_cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "chart.resourceNamePrefix" . }}scanner
{{- with .Values.scanner.cronjob.extraCronJobLabels }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- with .Values.scanner.cronjob.extraCronJobLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand All @@ -19,9 +20,10 @@ spec:
jobTemplate:
spec:
template:
{{- with .Values.scanner.cronjob.extraJobLabels }}
metadata:
labels:
{{- include "chart.labels" . | nindent 12 }}
{{- with .Values.scanner.cronjob.extraJobLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/scanner_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "chart.resourceNamePrefix" . }}scanner-config
labels:
{{- include "chart.labels" . | nindent 4 }}
type: Opaque
stringData:
scanner.yaml: |-
Expand Down
6 changes: 4 additions & 2 deletions charts/artifact-hub/templates/tracker_cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "chart.resourceNamePrefix" . }}tracker
{{- with .Values.tracker.cronjob.extraCronJobLabels }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- with .Values.tracker.cronjob.extraCronJobLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand All @@ -18,9 +19,10 @@ spec:
jobTemplate:
spec:
template:
{{- with .Values.tracker.cronjob.extraJobLabels }}
metadata:
labels:
{{- include "chart.labels" . | nindent 12 }}
{{- with .Values.tracker.cronjob.extraJobLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/tracker_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "chart.resourceNamePrefix" . }}tracker-config
labels:
{{- include "chart.labels" . | nindent 4 }}
type: Opaque
stringData:
tracker.yaml: |-
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/templates/trivy_pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "chart.resourceNamePrefix" . }}trivy
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
Expand Down

0 comments on commit a13901d

Please sign in to comment.