Skip to content

Commit 0aa529e

Browse files
authored
Allow install for arm and amd (#352)
Issue #, if available: `install-operator-sdk.sh` doesn't install the correct binary for arm architecture. Description of changes: This PR is being raised so that the operator sdk install script will work on both `arm` and `amd` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f9ab7cc commit 0aa529e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/install-operator-sdk.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ if [ "x${__operator_sdk_version}" == "x" ]; then
2626
fi
2727
if ! is_installed ${OPERATOR_SDK_BIN_PATH}/operator-sdk; then
2828
__platform=$(uname | tr '[:upper:]' '[:lower:]')
29+
__arch=$(uname -m | tr '[:upper:]' '[:lower:]')
2930
__tmp_install_dir=$(mktemp -d -t install-operator-sdk-XXX)
30-
__operator_sdk_url="https://github.com/operator-framework/operator-sdk/releases/download/v${__operator_sdk_version}/operator-sdk_${__platform}_amd64"
31+
__operator_sdk_url="https://github.com/operator-framework/operator-sdk/releases/download/v${__operator_sdk_version}/operator-sdk_${__platform}_${__arch}"
3132

3233
__install_dir=${OPERATOR_SDK_BIN_PATH}
3334
# If __install_dir does not exist, create it
3435
[[ -d $__install_dir ]] || mkdir -p "$__install_dir"
3536
__install_path="$__install_dir/operator-sdk"
3637

3738
echo -n "installing operator-sdk from ${__operator_sdk_url} ... "
38-
curl -sq -L ${__operator_sdk_url} --output ${__tmp_install_dir}/operator-sdk_${__platform}_amd64
39-
chmod +x ${__tmp_install_dir}/operator-sdk_${__platform}_amd64
40-
sudo mv "${__tmp_install_dir}/operator-sdk_${__platform}_amd64" "$__install_path"
39+
curl -sq -L ${__operator_sdk_url} --output ${__tmp_install_dir}/operator-sdk_${__platform}_${__arch}
40+
chmod +x ${__tmp_install_dir}/operator-sdk_${__platform}_${__arch}
41+
sudo mv "${__tmp_install_dir}/operator-sdk_${__platform}_${__arch}" "$__install_path"
4142
echo "ok."
4243
fi

0 commit comments

Comments
 (0)