From d03ac807fd7a2dde1da161001da383f8ae3e852b Mon Sep 17 00:00:00 2001 From: Dominique Burnand Date: Thu, 11 Jul 2024 09:23:27 +0200 Subject: [PATCH] Fix redis-availability check of the UI init-container in case externalRedis is enabled Signed-off-by: Dominique Burnand --- charts/falcosidekick/CHANGELOG.md | 4 ++++ charts/falcosidekick/Chart.yaml | 2 +- charts/falcosidekick/templates/deployment-ui.yaml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/falcosidekick/CHANGELOG.md b/charts/falcosidekick/CHANGELOG.md index 3ca11698..ac595c0c 100644 --- a/charts/falcosidekick/CHANGELOG.md +++ b/charts/falcosidekick/CHANGELOG.md @@ -5,6 +5,10 @@ numbering uses [semantic versioning](http://semver.org). Before release 0.1.20, the helm chart can be found in `falcosidekick` [repository](https://github.com/falcosecurity/falcosidekick/tree/master/deploy/helm/falcosidekick). +## 0.8.2 + +- Fix redis-availability check of the UI init-container in case externalRedis is enabled + ## 0.8.1 - allow to set resources, securityContext and image overwrite for wait-redis initContainer diff --git a/charts/falcosidekick/Chart.yaml b/charts/falcosidekick/Chart.yaml index 0c2b4301..4621acbb 100644 --- a/charts/falcosidekick/Chart.yaml +++ b/charts/falcosidekick/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 2.29.0 description: Connect Falco to your ecosystem icon: https://raw.githubusercontent.com/falcosecurity/falcosidekick/master/imgs/falcosidekick_color.png name: falcosidekick -version: 0.8.1 +version: 0.8.2 keywords: - monitoring - security diff --git a/charts/falcosidekick/templates/deployment-ui.yaml b/charts/falcosidekick/templates/deployment-ui.yaml index 34e2aa0c..705e823c 100644 --- a/charts/falcosidekick/templates/deployment-ui.yaml +++ b/charts/falcosidekick/templates/deployment-ui.yaml @@ -59,7 +59,11 @@ spec: initContainers: - name: wait-redis image: "{{ .Values.webui.initContainer.image.registry }}/{{ .Values.webui.initContainer.image.repository }}:{{ .Values.webui.initContainer.image.tag }}" + {{- if .Values.webui.redis.enabled }} command: ['sh', '-c', 'echo -e "Checking for the availability of the Redis Server"; while ! nc -z {{ include "falcosidekick.fullname" . }}-ui-redis 6379; do sleep 1; done; echo -e "Redis Server has started";'] + {{- else if .Values.webui.externalRedis.enabled }} + command: ['sh', '-c', 'echo -e "Checking for the availability of the Redis Server"; while ! nc -z {{ required "External Redis is enabled. Please set the URL to the database." .Values.webui.externalRedis.url }} {{ .Values.webui.externalRedis.port | default "6379" }}; do sleep 1; done; echo -e "Redis Server has started";'] + {{- end}} {{- if .Values.webui.initContainer.resources }} resources: {{- toYaml .Values.webui.initContainer.resources | nindent 12 }}