Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.deploymentLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.deploymentLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.deploymentAnnotations }}
annotations:
{{- if .Values.deploymentAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.deploymentAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
{{- if not .Values.horizontalAutoscaler.enabled }}
Expand Down
62 changes: 62 additions & 0 deletions tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,68 @@ templates:
- deployment.yml
- hpa.yml
tests:
- it: should omit deployment annotations by default
template: deployment.yml
asserts:
- isKind:
of: Deployment
- notExists:
path: metadata.annotations

- it: should render deployment annotations when commonAnnotations is specified
template: deployment.yml
set:
commonAnnotations:
test: value
asserts:
- isKind:
of: Deployment
- equal:
path: metadata.annotations
value:
test: value

- it: should render deployment annotations when deploymentAnnotations is specified
template: deployment.yml
set:
deploymentAnnotations:
test: value
asserts:
- isKind:
of: Deployment
- equal:
path: metadata.annotations
value:
test: value

- it: should render deployment annotations when commonAnnotations and deploymentAnnotations are specified
template: deployment.yml
set:
commonAnnotations:
value: test
deploymentAnnotations:
test: value
asserts:
- isKind:
of: Deployment
- equal:
path: metadata.annotations
value:
value: test
test: value

- it: should render deployment labels when deploymentLabels is specified
template: deployment.yml
set:
deploymentLabels:
test: value
asserts:
- isKind:
of: Deployment
- equal:
path: metadata.labels["test"]
value: value

- it: should render deployment replicas from replicas when autoscaling is disabled
template: deployment.yml
set:
Expand Down
8 changes: 8 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ image:
updateStrategy:
type: Recreate

## @param deploymentAnnotations Annotations to add to the deployment object
##
deploymentAnnotations: {}

## @param deploymentAnnotations Annotations to add to the deployment object
##
deploymentLabels: {}

## @param priorityClassName Stream pod priority class name
##
priorityClassName: ""
Expand Down
Loading