diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bb89bf48..d8f9ab6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/charts/logprep/Chart.yaml b/charts/logprep/Chart.yaml index 4a82df2fe..4a214dd10 100644 --- a/charts/logprep/Chart.yaml +++ b/charts/logprep/Chart.yaml @@ -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 diff --git a/charts/logprep/templates/deployment.yaml b/charts/logprep/templates/deployment.yaml index f5be0bf5d..18167c658 100644 --- a/charts/logprep/templates/deployment.yaml +++ b/charts/logprep/templates/deployment.yaml @@ -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 }} diff --git a/tests/unit/charts/test_deployment.py b/tests/unit/charts/test_deployment.py index f9a4a9810..2873dad36 100644 --- a/tests/unit/charts/test_deployment.py +++ b/tests/unit/charts/test_deployment.py @@ -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"]