From acd9438e4f5eaa132c7c29a53f3af8ee52cc0f02 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 10 May 2026 17:09:33 +0000 Subject: [PATCH] monitoring(grafana): swap python3 for jq in folder-ACL local-exec CI image (ci/Dockerfile) is alpine + jq, no python3. The grafana_admin_only_folder_acl null_resource was parsing /api/folders with a python3 oneliner, which crashed every CI apply with "python3: command not found" and made every monitoring stack apply fail in CI (worked locally because the dev VM has python3). jq is already in the CI image and produces the same output. --- stacks/monitoring/modules/monitoring/grafana.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacks/monitoring/modules/monitoring/grafana.tf b/stacks/monitoring/modules/monitoring/grafana.tf index cb1bcd93..2e4fa74e 100644 --- a/stacks/monitoring/modules/monitoring/grafana.tf +++ b/stacks/monitoring/modules/monitoring/grafana.tf @@ -196,7 +196,7 @@ resource "null_resource" "grafana_admin_only_folder_acl" { for i in $(seq 1 12); do FOLDER_UID=$(kubectl $KUBECONFIG_FLAG exec -n monitoring "$POD" -c grafana -- \ curl -sf -u "admin:$ADMIN_PW" "http://localhost:3000/api/folders" \ - | python3 -c "import json,sys; folders=json.load(sys.stdin); print(next((f['uid'] for f in folders if f['title']==sys.argv[1]), ''))" "$FOLDER" || true) + | jq -r --arg t "$FOLDER" 'first(.[] | select(.title == $t) | .uid) // ""' || true) if [ -n "$FOLDER_UID" ]; then break; fi sleep 5 done