do SCALE_POOL calculation only if necessary
Following an incident where midclt calls were hanging
This commit is contained in:
parent
c8c218f860
commit
f47d0d00ed
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
|
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
|
||||||
|
|
||||||
if is_cmd midclt; then
|
if is_cmd midclt && [ -z "$SCALE_POOL" ]; then
|
||||||
|
export SCALE_POOL=szmedia
|
||||||
|
|
||||||
export SCALE_POOL="$(midclt call "kubernetes.config" 2>/dev/null | jq -r '.pool')"
|
export SCALE_POOL="$(midclt call "kubernetes.config" 2>/dev/null | jq -r '.pool')"
|
||||||
[ -n "$SCALE_POOL" ] && [ "$SCALE_POOL" != "null" ] || export SCALE_POOL="$(midclt call "pool.query" 2>/dev/null | jq -r '.[0].name')"
|
[ -n "$SCALE_POOL" ] && [ "$SCALE_POOL" != "null" ] || export SCALE_POOL="$(midclt call "pool.query" 2>/dev/null | jq -r '.[0].name')"
|
||||||
[ -d "/mnt/$SCALE_POOL" ] || unset SCALE_POOL
|
[ -d "/mnt/$SCALE_POOL" ] || unset SCALE_POOL
|
||||||
|
|
Loading…
Reference in New Issue