From f47d0d00ed8c3e073292167e13e913f023aaeb24 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@kateryna)" Date: Tue, 24 Dec 2024 15:51:48 -0500 Subject: [PATCH] do SCALE_POOL calculation only if necessary Following an incident where midclt calls were hanging --- _home/private_dot_config/sz.env/PATH_truestuff.env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_home/private_dot_config/sz.env/PATH_truestuff.env b/_home/private_dot_config/sz.env/PATH_truestuff.env index bced20c..0095c06 100644 --- a/_home/private_dot_config/sz.env/PATH_truestuff.env +++ b/_home/private_dot_config/sz.env/PATH_truestuff.env @@ -1,6 +1,8 @@ #!/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')" [ -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