Fix empty TRITONSHELL_DATA_CENTERS var

This commit is contained in:
jhonas 2022-11-25 16:08:16 +01:00
parent 19e34f02b5
commit ada06c3c43
Signed by: teutat3s
GPG key ID: 924889A86D0B0FEB
2 changed files with 7 additions and 2 deletions

View file

@ -6,9 +6,14 @@ with pkgs.nodePackages;
# Docs: https://docs.greenbaum.cloud/en/devops/triton-cli.html
# triton CLI source: https://github.com/tritonDataCenter/node-triton
cnsBaseDomain=$TRITONSHELL_CNS_BASE_DOMAIN
dataCenters=$TRITONSHELL_DATA_CENTERS
mantaDomain=$TRITONSHELL_MANTA_DOMAIN
tritonApiDomain=$TRITONSHELL_TRITON_API_DOMAIN
if [ -n "$ZSH_VERSION" ]; then
IFS=" " read -r -A dataCenters <<< "$TRITONSHELL_DATA_CENTERS"
elif [ -n "$BASH_VERSION" ]; then
# https://github.com/koalaman/shellcheck/wiki/SC2206
IFS=" " read -r -a dataCenters <<< "$TRITONSHELL_DATA_CENTERS"
fi
# Set triton and docker host environment variables
eval "$(${triton}/bin/triton env)"

View file

@ -97,7 +97,7 @@ in
extra = ''
export \
TRITONSHELL_CNS_BASE_DOMAIN=${cnsBaseDomain} \
TRITONSHELL_DATA_CENTERS=(${pkgs.lib.concatStringsSep " " dataCenters}) \
TRITONSHELL_DATA_CENTERS="${pkgs.lib.concatStringsSep " " dataCenters}" \
TRITONSHELL_MANTA_DOMAIN=${mantaDomain} \
TRITONSHELL_TRITON_API_DOMAIN=${tritonApiDomain}
if [ -z "$TRITON_DONT_SOURCE_PROFILE" ]; then