diff --git a/charts/accountapp/Chart.yaml b/charts/accountapp/Chart.yaml index f273f55f8..e46fa088c 100644 --- a/charts/accountapp/Chart.yaml +++ b/charts/accountapp/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart for accounts.jenkins.io maintainers: - name: timja name: accountapp -version: 0.7.0 +version: 0.7.1 diff --git a/charts/accountapp/templates/deployment.yaml b/charts/accountapp/templates/deployment.yaml index 4a14f0454..871fb0e37 100644 --- a/charts/accountapp/templates/deployment.yaml +++ b/charts/accountapp/templates/deployment.yaml @@ -100,8 +100,10 @@ spec: path: /login port: http scheme: HTTP + {{- with .Values.resources }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/accountapp/tests/custom_values_test.yaml b/charts/accountapp/tests/custom_values_test.yaml index 490e44b41..5deeb477a 100644 --- a/charts/accountapp/tests/custom_values_test.yaml +++ b/charts/accountapp/tests/custom_values_test.yaml @@ -27,3 +27,27 @@ tests: - equal: path: data.smtpPassword value: c210cC1wYXNzd29yZA== + - it: should create a Deployment with the customized values + set: + image: + pullPolicy: Always + resources: + limits: + memory: 1024Mi + requests: + cpu: 500m + template: deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: spec.template.spec.containers[0].imagePullPolicy + value: Always + - equal: + path: spec.template.spec.containers[0].resources.limits.memory + value: 1024Mi + - equal: + path: spec.template.spec.containers[0].resources.requests.cpu + value: 500m diff --git a/charts/accountapp/tests/defaults_test.yaml b/charts/accountapp/tests/defaults_test.yaml index c48acabd8..d663044bd 100644 --- a/charts/accountapp/tests/defaults_test.yaml +++ b/charts/accountapp/tests/defaults_test.yaml @@ -19,3 +19,5 @@ tests: - equal: path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent + - notExists: + path: spec.template.spec.containers[0].resources diff --git a/charts/accountapp/values.yaml b/charts/accountapp/values.yaml index bde6e6da2..1a43216d1 100644 --- a/charts/accountapp/values.yaml +++ b/charts/accountapp/values.yaml @@ -29,8 +29,8 @@ ingress: # - secretName: accounts-tls # hosts: # - accounts.jenkins.io -resources: # We usually recommend not to specify default resources and to leave this as a conscious -# choice for the user. This also increases chances charts run on environments with little +# We usually recommend not to specify default resources and to leave this as a conscious: null # choice for the user. This also increases chances charts run on environments with little +resources: {} # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: