Add deployment labels to deployment (#649)
### Description of the change Applies `deployment.labels` to the deployment itself. ### Benefits Allows the user to add labels to the deployment. ### Possible drawbacks None ### Checklist - [X] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) - [X] Templating unittests are added Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/649 Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com> Co-authored-by: Dalton Russell <dalton.russell@tangramflex.com> Co-committed-by: Dalton Russell <dalton.russell@tangramflex.com>
This commit is contained in:
parent
4f4c71fb39
commit
dd304c1c1a
@ -8,6 +8,9 @@ metadata:
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "gitea.labels" . | nindent 4 }}
|
||||
{{- if .Values.deployment.labels }}
|
||||
{{- toYaml .Values.deployment.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
strategy:
|
||||
@ -397,4 +400,4 @@ spec:
|
||||
{{- else if not .Values.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- end }}
|
@ -15,3 +15,17 @@ tests:
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
name: gitea-unittests
|
||||
- it: deployment labels are set
|
||||
template: templates/gitea/deployment.yaml
|
||||
set:
|
||||
deployment.labels:
|
||||
hello: world
|
||||
asserts:
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
content:
|
||||
hello: world
|
||||
- isSubset:
|
||||
path: spec.template.metadata.labels
|
||||
content:
|
||||
hello: world
|
||||
|
Loading…
Reference in New Issue
Block a user