Skip to content

Commit

Permalink
Merge pull request #780 from dduportal/fix/account-app/fix-default-va…
Browse files Browse the repository at this point in the history
…lues

fix(account-app) correct default values for 'resources' to avoid YAML parsing error
  • Loading branch information
dduportal authored Sep 25, 2023
2 parents ff3c26a + a0d84ac commit 2b59d9e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/accountapp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion charts/accountapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
24 changes: 24 additions & 0 deletions charts/accountapp/tests/custom_values_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions charts/accountapp/tests/defaults_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ tests:
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: IfNotPresent
- notExists:
path: spec.template.spec.containers[0].resources
4 changes: 2 additions & 2 deletions charts/accountapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b59d9e

Please sign in to comment.