Skip to content

Commit

Permalink
add ability to configure init containers in helm chart (#712)
Browse files Browse the repository at this point in the history
* add ability to configure init containers in helm chart

* update chart version and changelog

---------

Co-authored-by: Jörg Zimmermann <[email protected]>
  • Loading branch information
djkhl and ekneg54 authored Nov 26, 2024
1 parent 4d80664 commit e976e88
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* fix `delimiter` typo in `StringSplitterRule` configuration

### Features

* configuration of `initContainers` in logprep helm chart is now possible

### Improvements

* fix `requester` documentation
Expand Down
2 changes: 1 addition & 1 deletion charts/logprep/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "14.0.1"
version: "14.1.0"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 4 additions & 0 deletions charts/logprep/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
{{- if .Values.secrets.imagePullSecret }}
- name: {{ .Values.secrets.imagePullSecret.name }}
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{- toYaml .Values.initContainers | nindent 8 }}
{{- end }}
containers:
- name: logprep
{{- if .Values.containerSecurityContext.enabled }}
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/charts/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ def test_add_security_context(self):
security_context = self.deployment["spec.template.spec.containers.0.securityContext"]
assert security_context["allowPriviledgeEscalation"] == "false"

def test_init_containers(self):
self.manifests = self.render_chart(
"logprep",
{
"initContainers": {"name": "test-init"},
},
)

assert self.deployment["spec.template.spec.initContainers"]
init_container = self.deployment["spec.template.spec.initContainers"]
assert init_container["name"] == "test-init"

def test_resources(self):
assert self.deployment["spec.template.spec.containers.0.resources"]
resources = self.deployment["spec.template.spec.containers.0.resources"]
Expand Down

0 comments on commit e976e88

Please sign in to comment.