diff --git a/application/templates/deployment.yaml b/application/templates/deployment.yaml index e6347308..0fd49384 100644 --- a/application/templates/deployment.yaml +++ b/application/templates/deployment.yaml @@ -20,7 +20,7 @@ metadata: name: {{ template "application.name" . }} namespace: {{ include "application.namespace" . }} spec: -{{- if .Values.deployment.replicas }} +{{- if not (quote .Values.deployment.replicas | empty) }} replicas: {{ .Values.deployment.replicas }} {{- end }} selector: diff --git a/application/tests/deployment_test.yaml b/application/tests/deployment_test.yaml index 30baea1f..28f895d9 100644 --- a/application/tests/deployment_test.yaml +++ b/application/tests/deployment_test.yaml @@ -57,6 +57,14 @@ tests: path: metadata.labels["app.kubernetes.io/version"] value: example-tag + - it: allows setting replicas zero + set: + deployment.replicas: 0 + asserts: + - equal: + path: spec.replicas + value: 0 + - it: uses image digest when given set: deployment.image.repository: example-image