fix generate_layout

it was putting the gnid in the wrong spot.
This commit is contained in:
James Andariese 2025-04-11 14:41:40 -05:00
parent 6f80f4fece
commit 89ede66f23

6
tools
View File

@ -65,14 +65,14 @@ generate_secrets() { # generates secrets required to run garage
generate_layout() {( # generates a sample layout, (args are included verbatim, e.g. -t k8s)
enumerate_pods | while read -r pod node gnid;do
kubectl get node/$node -o json | jq -r --arg zero "$ZERO" '
kubectl get node/$node -o json | jq -r --arg zero "$ZERO" --arg gnid "${gnid%%@*}" '
[
$zero,
"garage", "layout", "assign",
"garage", "layout", "assign", $gnid,
"-t", .metadata.name,
"-c", "\((.metadata.labels["strudelline.net/garage-data-free-bytes"]//"10737418240")|tonumber/1024/1024/1024|floor)G"
]+$ARGS.positional
| @sh' --args -- "$@" "${gnid%%@*}" | while read -r cmd;do
| @sh' --args -- "$@" | while read -r cmd;do
eval "set $cmd"
printf " %q" "$@" | cut -c 2-
done