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 }}