Skip to content

fix(localnet): remove prunes adopted external volumes - #269

Closed
srikanth-bitdynamics wants to merge 1 commit into
mainfrom
fix/remove-adopted-volumes
Closed

fix(localnet): remove prunes adopted external volumes#269
srikanth-bitdynamics wants to merge 1 commit into
mainfrom
fix/remove-adopted-volumes

Conversation

@srikanth-bitdynamics

Copy link
Copy Markdown
Collaborator

Problem

localnet remove tears down with docker compose down --volumes, which only
drops volumes Compose created — not ones it adopted as external (a
volume left by an earlier run of the same project). Those survive, so remove
violates its "reclaim everything" contract. On the persistent self-hosted e2e
runner this strands canton-<name>_postgres / _domain-upgrade-dump and fails
M1-RMV-001 / M1-CLN-001 ("volumes remain after remove") — currently red on
main too
, and the reason the e2e workflow carries a manual volume-prune
cleanup step as a band-aid.

Fix

After the compose teardown, remove prunes any lingering <project>_* volumes
by project prefix (ComposeRunner.PruneProjectVolumes). The _ anchor scopes
it to the exact project, so a sibling instance's volumes are never touched
(verified against real docker).

Tests

  • TestPruneProjectVolumesRemovesAdopted / ...NoopWhenEmpty (compose_test.go).
  • Real-docker sanity: the name=^<project>_ filter matches the project's
    volumes, excludes a sibling's, and rm -f clears them.
  • Full Go suite green; gofmt/vet clean.

Once merged, the workflow's manual volume-prune cleanup steps become redundant
and can be dropped (left for a follow-up to keep this diff focused).

`localnet remove` tears down via `docker compose down --volumes`, which only
drops volumes Compose created — not ones it adopted as external (a volume left
by an earlier run of the same project, common on a persistent CI runner). Those
survived, so remove violated its "reclaim everything" contract and left
canton-<name>_postgres / _domain-upgrade-dump behind (the e2e M1-RMV-001 /
M1-CLN-001 "volumes remain after remove" failure, also seen on main).

remove now prunes any lingering `<project>_*` volumes by project prefix after
the compose teardown. The `_` anchor scopes it to the exact project, so a
sibling instance's volumes are never touched.

@zheli zheli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the issue is with the test, not the code. As it works in my manual test. I will have a fix for the test later.

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

Labels

run-e2e Trigger e2e workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants