Skip to content

Commit 6ed432e

Browse files
committed
Allow operator-sdk from cross-platform local
Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
1 parent 0431e18 commit 6ed432e

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

hack/operator-sdk.sh

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,27 @@ BIN="operator-sdk"
1313
BIN_ARCH="${BIN}_${GOOS}_${GOARCH}"
1414
OPERATOR_SDK_DL_URL="https://github.com/operator-framework/operator-sdk/releases/download/v${VERSION}"
1515

16-
case ${GOOS} in
17-
linux)
18-
CHECKSUM="9596b2894b4b1d7f1c3b54cb1ec317b86494dbc00718b48561dfbcb232477c26"
19-
;;
20-
darwin)
21-
CHECKSUM="bb54842b92efee4ea1071373f7482b62a8130cc3dc4d45a5be50041ae7c81e7c"
22-
;;
23-
*)
24-
echo "Unsupported OS $GOOS"
25-
exit 1
26-
;;
27-
esac
28-
29-
if [ "$GOARCH" != "amd64" ]; then
16+
if [[ "$GOOS" != "linux" && "$GOOS" != "darwin" ]]; then
17+
echo "Unsupported OS $GOOS"
18+
exit 1
19+
fi
20+
21+
if [[ "$GOARCH" != "amd64" && "$GOARCH" != "arm64" && "$GOARCH" != "ppc64le" && "$GOARCH" != "s390x" ]]; then
3022
echo "Unsupported architecture $GOARCH"
3123
exit 1
3224
fi
3325

3426
command -v curl &> /dev/null || { echo "can't find curl command" && exit 1; }
35-
command -v sha256sum &> /dev/null || { echo "can't find sha256sum command" && exit 1; }
3627

3728
TEMPDIR=$(mktemp -d)
3829
BIN_PATH="${TEMPDIR}/${BIN_ARCH}"
3930

4031
echo "> downloading binary"
4132
curl --silent --location -o "${BIN_PATH}" "${OPERATOR_SDK_DL_URL}/operator-sdk_${GOOS}_${GOARCH}"
4233

43-
if [ "${VERIFY}" == "yes" ]; then
44-
echo "> verifying binary"
45-
echo "${CHECKSUM} ${BIN_PATH}" | sha256sum -c --quiet
46-
fi
47-
4834
echo "> installing binary"
4935
mv "${BIN_PATH}" "${OUTPUT_PATH}"
5036
chmod +x "${OUTPUT_PATH}"
5137
rm -rf "${TEMPDIR}"
38+
39+
echo "> operator-sdk binary available at ${OUTPUT_PATH}"

0 commit comments

Comments
 (0)