From 810ee6b12ae3a3c67f87c7369efda1d45e2d7365 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 30 Oct 2024 18:35:09 +0530 Subject: [PATCH] Add log message Signed-off-by: Mayank Shah --- .../charts/common/templates/_upgrade_checks.yaml.tpl | 6 ++++-- charts/everest/templates/hooks.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl b/charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl index d5647a6f..ab459699 100644 --- a/charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl +++ b/charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl @@ -1,5 +1,6 @@ # # @param .namespace The namespace where the operator is installed +# @param .version Version to upgrade to # @param .versionMetadataURL The URL of the version metadata service # {{- define "everest.preUpgradeChecks" }} @@ -24,11 +25,12 @@ spec: - | OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) - VERSION='1.2.0' + VERSION={{ .version }} apk add --no-cache --quiet curl curl -sSL -o everestctl https://github.com/percona/everest/releases/download/v${VERSION}/everestctl-${OS}-${ARCH} chmod -R 777 ./everestctl - + + echo "Checking requirements for upgrade to version ${VERSION}" ./everestctl upgrade --dry-run --version-metadata-url={{ .versionMetadataURL }} dnsPolicy: ClusterFirst restartPolicy: OnFailure diff --git a/charts/everest/templates/hooks.yaml b/charts/everest/templates/hooks.yaml index 15d3ac34..6cd538a9 100644 --- a/charts/everest/templates/hooks.yaml +++ b/charts/everest/templates/hooks.yaml @@ -1,3 +1,3 @@ {{- if .Values.upgrade.preflightChecks }} -{{- include "everest.preUpgradeChecks" (dict "namespace" (include "everest.namespace" .) "versionMetadataURL" .Values.versionMetadataURL) }} +{{- include "everest.preUpgradeChecks" (dict "namespace" (include "everest.namespace" .) "version" .Chart.Version "versionMetadataURL" .Values.versionMetadataURL) }} {{- end }}