From 9509b65b4ffb0b38e4adffbae91bc0998dd67be1 Mon Sep 17 00:00:00 2001 From: Angel Misevski Date: Fri, 4 Sep 2020 12:20:15 -0400 Subject: [PATCH] Check Operator SDK version in update nightly script Add a check in olm/update-nightly-olm-files.sh to check that the correct version of operator-sdk is installed. Otherwise, if a newer version is installed, the command will fail with a cryptic error message. Signed-off-by: Angel Misevski --- olm/update-nightly-olm-files.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/olm/update-nightly-olm-files.sh b/olm/update-nightly-olm-files.sh index f02afb9c0..a2e084487 100755 --- a/olm/update-nightly-olm-files.sh +++ b/olm/update-nightly-olm-files.sh @@ -17,6 +17,18 @@ BASE_DIR=$(cd "$(dirname "$0")"; pwd) TAG=$1 source ${BASE_DIR}/check-yq.sh +# Check for compatible version of operator-sdk: +OPERATOR_SDK_VERSION=$(operator-sdk version | sed -E 's|.*version: (v[0-9]+.[0-9]+\.[0-9]+).*|\1|') +case $OPERATOR_SDK_VERSION in + v0.10.*) + echo "Operator SDK $OPERATOR_SDK_VERSION installed" + ;; + *) + echo "This script requires Operator SDK v0.10.x. Please install the correct version to continue" + exit 1 + ;; +esac + for platform in 'kubernetes' 'openshift' do packageName=eclipse-che-preview-${platform}