Skip to content

Harden delete-mode validation and registry startup behavior#4

Open
junwha wants to merge 1 commit intomainfrom
codex/add-delete-mode-support
Open

Harden delete-mode validation and registry startup behavior#4
junwha wants to merge 1 commit intomainfrom
codex/add-delete-mode-support

Conversation

@junwha
Copy link
Owner

@junwha junwha commented Feb 24, 2026

Motivation

  • Fix a startup failure when running the registry with Podman if the host bind-mount path specified by DDIFF_REGISTRY_VOLUME does not exist.
  • Make non-interactive registry startup more robust in CI-like or restricted environments where -it and Podman networking may fail.
  • Add first-class support for deleting manifests (explicit delete command and --delete on load) and provide an integration test that validates delete + GC flows.

Description

  • Ensure the host registry volume path is created before launching the registry by adding Path(ddiff_register_volume).mkdir(parents=True, exist_ok=True) inside run_registry() and remove -it from the run invocation to avoid interactive flags in non-TTY runs.
  • Add _request_manifest_digest() and delete_image() functions to resolve a manifest digest, issue an HTTP DELETE to the registry, and trigger registry garbage-collect via podman/docker exec.
  • Add --delete handling to load (load_image(..., delete_after_load=True)) and register a new top-level delete command for explicit deletion.
  • Add test/test_delete_mode.sh which builds local images, starts a local registry with delete API enabled, generates a diff archive, verifies ddiff delete <tag>, and verifies ddiff load --delete removes the manifest; the script also improves registry image detection and pre-creates registry volume dirs.
  • Update README.md to document the server delete behaviour and the load/delete usage.

Testing

  • Ran python3 -m py_compile ddiff.py which completed successfully.
  • Ran syntax check bash -n test/test_delete_mode.sh which passed.
  • Ran ./test/test_delete_mode.sh in this environment which exercises the updated flows but exited with SKIP because Podman networking namespace setup is not permitted here (setns: IO error: Operation not permitted), and the test correctly reports SKIP by design rather than a failure.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant