Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GOPROXY ?= https://proxy.golang.org
# ----------------------------------------------------------------------------------------------------------------------
# Set the location of the Operator SDK executable
# ----------------------------------------------------------------------------------------------------------------------
OPERATOR_SDK_VERSION := v1.41.1
OPERATOR_SDK_VERSION := v1.42.0

# ----------------------------------------------------------------------------------------------------------------------
# Options to append to the Maven command
Expand Down
22 changes: 15 additions & 7 deletions hack/ensure-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh

REQUIRED_VERSION="$(curl -s https://api.github.com/repos/operator-framework/operator-sdk/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"

#
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#

OPERATOR_SDK_VERSION=$1
#OPERATOR_SDK_VERSION="$(curl -s https://api.github.com/repos/operator-framework/operator-sdk/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
OPERATOR_SDK_HOME=$2

UNAME_S=$(uname -s)
Expand All @@ -19,7 +27,7 @@ else
echo "Operator SDK found, checking version - ${OPERATOR_SDK}"
VERSION=$(${OPERATOR_SDK} version)
echo "${VERSION}"
echo ${VERSION} | grep "operator-sdk version: \"${REQUIRED_VERSION}\""
echo ${VERSION} | grep "operator-sdk version: \"${OPERATOR_SDK_VERSION}\""
OK=$?
fi

Expand All @@ -28,19 +36,19 @@ if [ ${OK} != 0 ]; then

if [ "${UNAME_S}" = "Darwin" ]; then
if [ "${UNAME_M}" = "x86_64" ]; then
URL="https://github.com/operator-framework/operator-sdk/releases/download/${REQUIRED_VERSION}/operator-sdk_darwin_amd64"
URL="https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_darwin_amd64"
else
URL="https://github.com/operator-framework/operator-sdk/releases/download/${REQUIRED_VERSION}/operator-sdk_darwin_arm64"
URL="https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_darwin_arm64"
fi
else
if [ "${UNAME_M}" = "x86_64" ]; then
URL="https://github.com/operator-framework/operator-sdk/releases/download/${REQUIRED_VERSION}/operator-sdk_linux_amd64"
URL="https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64"
else
URL="https://github.com/operator-framework/operator-sdk/releases/download/${REQUIRED_VERSION}/operator-sdk_linux_arm64"
URL="https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_linux_arm64"
fi
fi

echo "Downloading Operator SDK ${UNAME_S}/${UNAME_M} version ${REQUIRED_VERSION} from ${URL}"
echo "Downloading Operator SDK ${UNAME_S}/${UNAME_M} version ${OPERATOR_SDK_VERSION} from ${URL}"
curl -L ${URL} -o ${OPERATOR_SDK}
chmod +x ${OPERATOR_SDK}
fi
Expand Down
Loading