Skip to content

Commit 0074c80

Browse files
authored
Fix download vault script for arm64 processor
install_vault.sh just download and unzip binary vault for amd64, which cannot be executed on arm64 architecture processors. Add architecture checking in bash script to support this. Signed-off-by: maaaace <[email protected]> Original pull request: gh-402.
1 parent 12433c6 commit 0074c80

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/test/bash/install_vault.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ UNAME=$(uname -s | tr '[:upper:]' '[:lower:]')
1414
VERBOSE=false
1515
VAULT_DIRECTORY=vault
1616
DOWNLOAD_DIRECTORY=download
17+
PLATFORM=amd64
1718
readonly script_name="$(basename "${BASH_SOURCE[0]}")"
1819

1920
function say() {
@@ -123,7 +124,7 @@ function download() {
123124
function download_oss() {
124125

125126
VAULT_VER="${VAULT_VER:-${VAULT_OSS}}"
126-
VAULT_ZIP="vault_${VAULT_VER}_${UNAME}_amd64.zip"
127+
VAULT_ZIP="vault_${VAULT_VER}_${UNAME}_${PLATFORM}.zip"
127128
VAULT_FILE=${VAULT_ZIP}
128129
VAULT_URL="https://releases.hashicorp.com/vault/${VAULT_VER}/${VAULT_ZIP}"
129130

@@ -134,8 +135,8 @@ function download_oss() {
134135
function download_enterprise() {
135136

136137
VAULT_VER="${VAULT_VER:-${VAULT_ENT}}"
137-
VAULT_ZIP="vault-enterprise_${VAULT_VER}%2Bent_${UNAME}_amd64.zip"
138-
VAULT_FILE="vault-enterprise_${VAULT_VER}+ent_${UNAME}_amd64.zip"
138+
VAULT_ZIP="vault-enterprise_${VAULT_VER}%2Bent_${UNAME}_${PLATFORM}.zip"
139+
VAULT_FILE="vault-enterprise_${VAULT_VER}+ent_${UNAME}_${PLATFORM}.zip"
139140
VAULT_URL="http://hc-enterprise-binaries.s3.amazonaws.com/vault/ent/${VAULT_VER}/${VAULT_ZIP}"
140141

141142
download
@@ -146,7 +147,9 @@ function main() {
146147

147148
initialize
148149
parse_options "$@"
149-
150+
if [ "$(uname -m)" == aarch64 ]; then
151+
PLATFORM=arm64
152+
fi
150153
if [[ ${EDITION} == 'oss' ]]; then
151154
download_oss
152155
elif [[ ${EDITION} == 'enterprise' ]]; then

0 commit comments

Comments
 (0)