From b00fb58375539057ab1c66b87d727f9743a081cd Mon Sep 17 00:00:00 2001 From: Harry Waye Date: Tue, 10 May 2022 08:56:22 +0000 Subject: [PATCH 1/4] fix(clickhouse-operator): pin docker image version Previously we were using the latest available image. Here we pin to the latest image. It looks like they version the chart and the operator image the same. It may be worth pinning them to the same version. However, this will cause the operator to downgrade in existing installs, so here I'm opting to try to keep the image version the same as current installs. --- .../templates/clickhouse-operator/deployment.yaml | 4 ++-- scripts/clickhouse_operator_sync.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/posthog/templates/clickhouse-operator/deployment.yaml b/charts/posthog/templates/clickhouse-operator/deployment.yaml index 53d66a395..1da0118bb 100644 --- a/charts/posthog/templates/clickhouse-operator/deployment.yaml +++ b/charts/posthog/templates/clickhouse-operator/deployment.yaml @@ -3,7 +3,7 @@ # # NAMESPACE=posthog # COMMENT= -# OPERATOR_IMAGE=altinity/clickhouse-operator:latest +# OPERATOR_IMAGE=altinity/clickhouse-operator:0.19.0 # METRICS_EXPORTER_IMAGE=altinity/metrics-exporter:latest # # Setup Deployment for clickhouse-operator @@ -47,7 +47,7 @@ spec: name: etc-clickhouse-operator-usersd-files containers: - name: clickhouse-operator - image: altinity/clickhouse-operator:latest + image: altinity/clickhouse-operator:0.19.0 imagePullPolicy: Always volumeMounts: - name: etc-clickhouse-operator-folder diff --git a/scripts/clickhouse_operator_sync.sh b/scripts/clickhouse_operator_sync.sh index fa13c7d1e..8d7b88bfd 100755 --- a/scripts/clickhouse_operator_sync.sh +++ b/scripts/clickhouse_operator_sync.sh @@ -28,7 +28,7 @@ URL="https://raw.githubusercontent.com/Altinity/clickhouse-operator/${CLICKHOUSE # OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-test-clickhouse-operator}" METRICS_EXPORTER_NAMESPACE="${OPERATOR_NAMESPACE}" -OPERATOR_IMAGE="${OPERATOR_IMAGE:-altinity/clickhouse-operator:latest}" +OPERATOR_IMAGE="${OPERATOR_IMAGE:-altinity/clickhouse-operator:0.19.0}" METRICS_EXPORTER_IMAGE="${METRICS_EXPORTER_IMAGE:-altinity/metrics-exporter:latest}" curl -s "${URL}" | \ @@ -57,16 +57,16 @@ kubectl-slice -f "$TMP_FOLDER/clickhouse-operator.yaml" -o "${CHART_PATH}/templa FILES="${CHART_PATH}/templates/clickhouse-operator/*" for f in $FILES do - sed -i '' '1i\ + sed -i'' '1i\ {{- if .Values.clickhouse.enabled }} ' "$f" - sed -i '' '$a\ + sed -i'' '$a\ {{- end }} ' "$f" - sed -i '' 's/#namespace: posthog$/namespace: {{ .Values.clickhouse.namespace | default .Release.Namespace }}/g' "$f" + sed -i'' 's/#namespace: posthog$/namespace: {{ .Values.clickhouse.namespace | default .Release.Namespace }}/g' "$f" - sed -i '' 's/namespace: posthog$/namespace: {{ .Values.clickhouse.namespace | default .Release.Namespace }}/g' "$f" + sed -i'' 's/namespace: posthog$/namespace: {{ .Values.clickhouse.namespace | default .Release.Namespace }}/g' "$f" done From 2991a906aa33c1a33efb8920ffddc3035d8872a1 Mon Sep 17 00:00:00 2001 From: Harry Waye Date: Tue, 10 May 2022 09:04:27 +0000 Subject: [PATCH 2/4] update snapshot; --- .../tests/clickhouse-operator/__snapshot__/deployment.yaml.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/posthog/tests/clickhouse-operator/__snapshot__/deployment.yaml.snap b/charts/posthog/tests/clickhouse-operator/__snapshot__/deployment.yaml.snap index c85100e02..a04d08203 100644 --- a/charts/posthog/tests/clickhouse-operator/__snapshot__/deployment.yaml.snap +++ b/charts/posthog/tests/clickhouse-operator/__snapshot__/deployment.yaml.snap @@ -62,7 +62,7 @@ the manifest should match the snapshot when using default values: resourceFieldRef: containerName: clickhouse-operator resource: limits.memory - image: altinity/clickhouse-operator:latest + image: altinity/clickhouse-operator:0.19.0 imagePullPolicy: Always name: clickhouse-operator volumeMounts: From b49d45df3066c26f871f1630142db429ecd89791 Mon Sep 17 00:00:00 2001 From: Harry Waye Date: Tue, 10 May 2022 09:08:08 +0000 Subject: [PATCH 3/4] Add comment --- scripts/clickhouse_operator_sync.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/clickhouse_operator_sync.sh b/scripts/clickhouse_operator_sync.sh index 8d7b88bfd..6464f5043 100755 --- a/scripts/clickhouse_operator_sync.sh +++ b/scripts/clickhouse_operator_sync.sh @@ -28,6 +28,11 @@ URL="https://raw.githubusercontent.com/Altinity/clickhouse-operator/${CLICKHOUSE # OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-test-clickhouse-operator}" METRICS_EXPORTER_NAMESPACE="${OPERATOR_NAMESPACE}" +# NOTE: we pin to 0.19.0 here which is different to the 0.16.1 chart version. +# Prior to pinning we were specifying latest, so to ensure that the version +# doesn't change on existing installs we pin to latest as of writing, thereby +# mitigating the possibility that chart will unexpectedly update, while also +# maintaining current functionality. OPERATOR_IMAGE="${OPERATOR_IMAGE:-altinity/clickhouse-operator:0.19.0}" METRICS_EXPORTER_IMAGE="${METRICS_EXPORTER_IMAGE:-altinity/metrics-exporter:latest}" From a97a08386eacf4a0a3e1649b219ac37d9326ef11 Mon Sep 17 00:00:00 2001 From: Harry Waye Date: Tue, 10 May 2022 09:10:47 +0000 Subject: [PATCH 4/4] fix --- scripts/clickhouse_operator_sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/clickhouse_operator_sync.sh b/scripts/clickhouse_operator_sync.sh index 6464f5043..eb9ad7f4d 100755 --- a/scripts/clickhouse_operator_sync.sh +++ b/scripts/clickhouse_operator_sync.sh @@ -28,7 +28,7 @@ URL="https://raw.githubusercontent.com/Altinity/clickhouse-operator/${CLICKHOUSE # OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-test-clickhouse-operator}" METRICS_EXPORTER_NAMESPACE="${OPERATOR_NAMESPACE}" -# NOTE: we pin to 0.19.0 here which is different to the 0.16.1 chart version. +# NOTE: we pin to 0.19.0 here which is different to the 0.16.1 manifest version. # Prior to pinning we were specifying latest, so to ensure that the version # doesn't change on existing installs we pin to latest as of writing, thereby # mitigating the possibility that chart will unexpectedly update, while also