Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAE-26793 Add support for common container deployment args values #288

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading