diff --git a/charts/reports/templates/deployment.yaml b/charts/reports/templates/deployment.yaml index 47a62ac8d..bbc80a9a7 100644 --- a/charts/reports/templates/deployment.yaml +++ b/charts/reports/templates/deployment.yaml @@ -51,8 +51,10 @@ spec: mountPath: /usr/share/nginx/html - name: config mountPath: /etc/nginx/conf.d + {{- with .Values.resources }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- end}} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -66,9 +68,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: - {{- with .Values.htmlVolume }} - name: html - {{- toYaml . | nindent 10 }} + {{- if .Values.htmlVolume }} +{{ toYaml .Values.htmlVolume | indent 10 }} + {{- else }} + emptyDir: {} {{- end }} - name: config configMap: diff --git a/charts/reports/tests/defaults_values_test.yaml b/charts/reports/tests/defaults_values_test.yaml index afd61ebaa..37ce4aaf6 100644 --- a/charts/reports/tests/defaults_values_test.yaml +++ b/charts/reports/tests/defaults_values_test.yaml @@ -20,6 +20,20 @@ tests: - equal: path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent + - equal: + path: metadata.labels["app.kubernetes.io/name"] + value: reports + - equal: + path: metadata.labels["app.kubernetes.io/managed-by"] + value: Helm + - equal: + path: spec.template.spec.volumes[0].name + value: html + - equal: + path: spec.template.spec.volumes[0].emptyDir + value: {} + - notExists: + path: spec.template.spec.containers[0].resources - it: should not generate any pdb with default values template: pdb.yaml asserts: