From e2375a49d2418accd52a1a72156c43a0b5ef7083 Mon Sep 17 00:00:00 2001 From: ximenchuifeng Date: Sat, 22 Aug 2026 13:45:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(promote):=20=E5=9F=BA=E7=BA=BF=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=80=82=E9=85=8D=E7=9C=9F=E5=AE=9E=E4=B8=A4=E5=B1=82?= =?UTF-8?q?=E7=BB=93=E6=9E=84(=E4=BF=AE=E5=A4=8D=20walk=20=E5=8F=B6?= =?UTF-8?q?=E5=AD=90=E8=AF=AF=E5=BD=93=20dict=20+=20=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=A7=A3=E5=8C=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci/promote.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/promote.sh b/ci/promote.sh index 51dabe0..41ffa2a 100755 --- a/ci/promote.sh +++ b/ci/promote.sh @@ -85,10 +85,12 @@ lines = [] def walk(prefix, node): for k, v in node.items(): key = f"{prefix}.{k}" if prefix else k - if isinstance(v, dict): - walk(key, v) + if not isinstance(v, dict): + continue + if "repository" in v and "tag" in v: + lines.append((key, v["repository"], v["tag"])) else: - lines.append((key, v.get("repository", ""), v.get("tag", ""))) + walk(key, v) walk("", images) out, skipped = [], [] for key, repo, tag in lines: @@ -98,7 +100,7 @@ for key, repo, tag in lines: sys.exit(f"[promote] 错误: demo image-version 中 {key} 缺 repository/tag") out.append(f"{repo} {tag}") open(dst, "w", encoding="utf-8").write("\n".join(out) + "\n") -print(f"[promote] 交付基线 {len(out)} 个镜像: " + ", ".join(r for r, _ in out)) +print(f"[promote] 交付基线 {len(out)} 个镜像: " + ", ".join(l.split()[0] for l in out)) if skipped: print(f"[promote] 跳过 protocol 镜像: {', '.join(skipped)}") PY