diff --git a/deploy/run-production-canary.sh b/deploy/run-production-canary.sh index 50ad776..9f7756a 100644 --- a/deploy/run-production-canary.sh +++ b/deploy/run-production-canary.sh @@ -53,9 +53,9 @@ JSON ) stable_json="$(curl -fsS --max-time 10 "$SUPERVISOR_CONTROL_URL/v1/state")" -stable_set="$(printf '%s' "$stable_json" | python3 -c "import json,sys; s=json.load(sys.stdin).get('stable_release_set'); print(json.dumps(s,separators=(',',':')) if s else '')")" +stable_set=$(printf '%s' "$stable_json" | jq -c '.stable_release_set // empty') if [[ -z "$stable_set" ]]; then - stable_revision="$(printf '%s' "$stable_json" | python3 -c "import json,sys; print(json.load(sys.stdin).get('current',{}).get('version','unknown'))")" + stable_revision=$(printf '%s' "$stable_json" | jq -r '.current.version // "unknown"') stable_set="$(cat </dev/null || fail_rollback -observation=$(printf '%s' "$release_json" | python3 -c 'import json,sys,time; s=json.load(sys.stdin); print(json.dumps({"release_id":s["id"],"ready":True,"reason":"all ReleaseSet healthchecks and image revisions passed","observed_at_unix_millis":int(time.time()*1000),"components":{k:{"revision":v["revision"],"health":True,"ready":True} for k,v in s["components"].items()}},separators=(",",":")))') +observation=$(cat </dev/null || fail_rollback control /v1/traffic/canary || fail_rollback