From a11d5fa79e6da0ec9e60d36e9aec65876b48e782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20Salceda?= Date: Tue, 7 Apr 2020 16:37:46 +0200 Subject: [PATCH] [stable/sysdig] Add a hack to implement watches on Helm based Operator (#21822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implementation in operators breaks the pattern in some Helm based operators about using an splitted image description: https://github.com/helm/charts/blob/master/stable/postgresql/values.yaml#L15 https://github.com/helm/charts/blob/master/stable/prometheus/values.yaml#L534 https://github.com/helm/charts/blob/master/stable/redis/values.yaml#L15 https://github.com/helm/charts/blob/master/stable/wordpress/values.yaml#L14 But is required to certify the operator. https://github.com/operator-framework/operator-sdk/blob/master/doc/helm/user-guide.md#passing-environment-variables-to-the-helm-chart Signed-off-by: Néstor Salceda --- stable/sysdig/CHANGELOG.md | 7 +++++++ stable/sysdig/Chart.yaml | 2 +- stable/sysdig/templates/_helpers.tpl | 20 ++++++++++++-------- stable/sysdig/values.yaml | 6 ++++++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/stable/sysdig/CHANGELOG.md b/stable/sysdig/CHANGELOG.md index 10e2de8d0c..3f514c4c1f 100644 --- a/stable/sysdig/CHANGELOG.md +++ b/stable/sysdig/CHANGELOG.md @@ -3,6 +3,13 @@ This file documents all notable changes to Sysdig Helm Chart. The release numbering uses [semantic versioning](http://semver.org). +## v1.7.8 + +### Minor changes + +* Add a image.overrideValue value which is a hack to support + RELATED_IMAGE_ feature in Helm based operators. + ## v1.7.7 ### Minor changes diff --git a/stable/sysdig/Chart.yaml b/stable/sysdig/Chart.yaml index ceefa1324b..263519bc5d 100755 --- a/stable/sysdig/Chart.yaml +++ b/stable/sysdig/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: sysdig -version: 1.7.7 +version: 1.7.8 appVersion: 9.8.0 description: Sysdig Monitor and Secure agent keywords: diff --git a/stable/sysdig/templates/_helpers.tpl b/stable/sysdig/templates/_helpers.tpl index 5564119168..5aa82836ed 100644 --- a/stable/sysdig/templates/_helpers.tpl +++ b/stable/sysdig/templates/_helpers.tpl @@ -54,17 +54,21 @@ Helm 2.11 supports the assignment of a value to a variable defined in a differen but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. Also, we can't use a single if because lazy evaluation is not an option */}} -{{- if .Values.slim.enabled }} -{{- $repositoryName = printf "%s-%s" .Values.image.repository "slim" -}} -{{- end -}} -{{- if .Values.global }} - {{- if .Values.global.imageRegistry }} - {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} +{{- if .Values.image.overrideValue }} + {{- printf .Values.image.overrideValue -}} +{{- else -}} + {{- if .Values.slim.enabled }} + {{- $repositoryName = printf "%s-%s" .Values.image.repository "slim" -}} + {{- end -}} + {{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} {{- else -}} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- end -}} -{{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- end -}} {{- end -}} diff --git a/stable/sysdig/values.yaml b/stable/sysdig/values.yaml index be42494ead..ac6691e67b 100644 --- a/stable/sysdig/values.yaml +++ b/stable/sysdig/values.yaml @@ -1,6 +1,12 @@ # Default values for Sysdig Monitor and Secure Helm package. image: + # This is a hack to support RELATED_IMAGE_ feature in Helm based + # Operators + # + # As long as I don't want to people to use this, I will keep it undocumented + overrideValue: + registry: docker.io repository: sysdig/agent tag: 9.8.0