Merge pull request #2739 from pikasTech/fix/registry-gc-fast-submit
让 registry GC 在短连接内返回 job id
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
- 不支持的目标、PVC 未绑定、存储布局不可读或 workload 形状漂移时必须 fail closed。
|
||||
- `gc remote <providerId> run --confirm --include-registry`:
|
||||
- 作为异步 job 返回,并通过 `gc remote <providerId> status --job-id <id>` 短查询;
|
||||
- submit 路径不得在返回 job id 前同步重复完整 plan;完整候选重算、writer guard 和运行面 preflight 在异步 job 内完成;
|
||||
- 只通过 Registry API 删除 plan 中不受保护的 manifest;
|
||||
- 对 YAML 声明的 Registry Deployment 缩容后运行官方 `registry garbage-collect`;
|
||||
- PVC 只挂载给 GC Pod,不删除 PVC、PV、blob 目录、containerd 或 k3s storage;
|
||||
|
||||
@@ -2779,6 +2779,18 @@ def main():
|
||||
if (bool(OPTIONS.get("registry")) or bool(OPTIONS.get("hwlabRegistry"))) and ACTION == "plan":
|
||||
emit_json(registry_plan_payload(observed_at), persist_large=True)
|
||||
return 0
|
||||
if (bool(OPTIONS.get("registry")) or bool(OPTIONS.get("hwlabRegistry"))) and ACTION == "run":
|
||||
mode = "garbage-collect" if bool(OPTIONS.get("registryGcOnly")) else "retention"
|
||||
emit_json({
|
||||
"ok": True,
|
||||
"action": "gc remote run",
|
||||
"providerId": PROVIDER_ID,
|
||||
"dryRun": False,
|
||||
"mutation": True,
|
||||
"observedAt": observed_at,
|
||||
"result": start_registry_retention_job(mode),
|
||||
}, persist_large=False)
|
||||
return 0
|
||||
preflight = cluster_preflight()
|
||||
if ACTION == "policy-plan":
|
||||
emit_json(remote_policy_plan_payload(observed_at), persist_large=False)
|
||||
|
||||
Reference in New Issue
Block a user