Skip to content

Commit

Permalink
AAE-26793 Add support for common container deployment args values (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
igdianov authored Oct 15, 2024
1 parent 8caaeb8 commit 7d24881
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ A Helm chart for Activiti Cloud Common Templates
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | allows customising affinity |
| args | string | `nil` | use to customize container args |
| config.args | string | `"-c"` | |
| config.command | string | `"sh"` | |
| config.env.APPLICATION_PROPERTIES | string | `"{{ .Values.config.mountPath | trimSuffix \"/\" }}/application.properties"` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/common/templates/_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ tpl (toString .Values.image.repository) . }}:{{ tpl (toString .Values.image.tag) . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.args }}
args:
{{ toYaml . | nindent 12 }}
{{- end }}
env:
{{ $envTemplate := tpl "common.{{ .Values.service.envType }}-env" . }}
{{ include $envTemplate . | nindent 12 }}
Expand Down
28 changes: 28 additions & 0 deletions charts/common/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,31 @@ tests:
- equal:
path: spec.template.spec.containers[0].livenessProbe.httpGet.path
value: /rb/actuator/health

- it: should render deployment with no args by default
set:
enabled: true
asserts:
- isKind:
of: Deployment
- hasDocuments:
count: 1
- notExists:
path: spec.template.spec.containers[0].args

- it: should render deployment with custom args
set:
enabled: true
args: [ "-jar", "consumer.jar" ]
asserts:
- isKind:
of: Deployment
- hasDocuments:
count: 1
- exists:
path: spec.template.spec.containers[0].args
- equal:
path: spec.template.spec.containers[0].args
value:
- "-jar"
- "consumer.jar"
3 changes: 3 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ image:
tag: latest
pullPolicy: IfNotPresent

# args -- use to customize container args
args:

# registryPullSecrets -- configures additional pull secrets for this deployment
registryPullSecrets: []

Expand Down

0 comments on commit 7d24881

Please sign in to comment.