You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traffic_revisions="$(python -c 'import json,sys; svc=json.load(sys.stdin); print("\n".join(t.get("revisionName","") for t in svc.get("status",{}).get("traffic",[]) if t.get("revisionName") and int(t.get("percent",0)) > 0))' <<< "${service_json}")"
464
+
465
+
keep_revision() {
466
+
local revision="$1"
467
+
if [ "${revision}" = "${latest_revision}" ]; then
468
+
return 0
469
+
fi
470
+
if printf '%s\n' "${traffic_revisions}" | grep -Fxq "${revision}"; then
471
+
return 0
472
+
fi
473
+
return 1
474
+
}
475
+
476
+
while IFS= read -r revision; do
477
+
if [ -z "${revision}" ] || keep_revision "${revision}"; then
old_digests="$(gcloud artifacts docker images list "${image_repo}" \
492
+
--project="${GCP_PROJECT_ID}" \
493
+
--include-tags \
494
+
--format=json \
495
+
| python -c 'import json,os,sys; keep=os.environ["GITHUB_SHA"]; rows=json.load(sys.stdin); print("\n".join(row["version"] for row in rows if keep not in set(row.get("tags") or [])))')"
0 commit comments