prune: merge exported live-image files into protection (multi-cluster)
ACTIVITY-WP-0020-T07: the kubectl scan only sees the prune host's own cluster. New repeatable --live-images-file merges image refs exported from other production clusters; missing file surfaces as WARN (reduced coverage), forgejo-registry tags protected, other registries ignored. 5/5 tests. Evidence gathered 2026-07-18: activity-core on railiance01 runs a locally-imported image (activity-core:railiance01-prod), not a forgejo registry tag — the largest would_delete set has no live registry consumer. Live forgejo tags: state-hub:main-1cf949b (railiance01), issue-core:0.2.1 + state-hub:f2e042a + vergabe-teilnahme:064d295 (coulombcore cluster). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d4c95f78ff
commit
ca4e1526bd
2 changed files with 72 additions and 1 deletions
|
|
@ -95,4 +95,27 @@ image:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
||||
def test_collect_live_images_from_files(tmp_path):
|
||||
from scripts.forgejo_package_prune import collect_live_images_from_files
|
||||
|
||||
export = tmp_path / "live-coulombcore.txt"
|
||||
export.write_text(
|
||||
"# exported 2026-07-18\n"
|
||||
"forgejo.coulomb.social/coulomb/issue-core:0.2.1\n"
|
||||
"forgejo.coulomb.social/coulomb/state-hub:f2e042a\n"
|
||||
"gitea.coulomb.social/coulomb/core-hub:3ed8531\n"
|
||||
"nats:2.10-alpine\n"
|
||||
"\n"
|
||||
)
|
||||
protected, notes = collect_live_images_from_files(
|
||||
[export, tmp_path / "missing.txt"]
|
||||
)
|
||||
|
||||
assert ("container", "issue-core", "0.2.1") in protected
|
||||
assert ("container", "state-hub", "f2e042a") in protected
|
||||
# non-forgejo registries and bare images are ignored
|
||||
assert all(name != "core-hub" for (_, name, _) in protected)
|
||||
assert len(protected) == 2
|
||||
assert any("missing.txt" in n for n in notes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue