Skip to content

fix: teardown removes the lease file the daemon writes - #19

Closed
CMGS wants to merge 3 commits into
mainfrom
fix/lease-path-under-state-dir
Closed

fix: teardown removes the lease file the daemon writes#19
CMGS wants to merge 3 commits into
mainfrom
fix/lease-path-under-state-dir

Conversation

@CMGS

@CMGS CMGS commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Teardown deleted <state-dir>/leases.json while the daemon persisted leases at its constant default /var/lib/cocoon/net/leases.json, so a custom --state-dir left the lease file behind. The default stays the constant path, independent of --state-dir (vk-cocoon's reader defaults to the same file), and teardown now removes exactly that file; --lease-file still overrides the daemon and a custom file is kept on teardown.

Also: the enis: dry-run row, the --lease-file and lease-path documentation, a restating comment in platform/ip_test.go, and the reason volcengine Adopt is a no-op.

Gates: make lint 0 issues on GOOS=linux and darwin, make fmt-check, asl ./... on both GOOS, go test -race -count=1 ./....

CMGS added 3 commits September 3, 2026 13:37
The daemon hardcoded /var/lib/cocoon/net/leases.json while teardown deletes
<state-dir>/leases.json, so a custom --state-dir made the daemon persist
leases outside the state directory and teardown remove a file nothing wrote.
The flag now defaults to empty and resolves to <state-dir>/leases.json at run
time; the default installation path is unchanged.

Two adjacent output fixes: --primary-nic help claimed auto-detection when the
real fallback is platform.DefaultNIC, and adopt --dry-run did not list the ENI
IDs it records into pool.json for teardown to delete.
@CMGS CMGS changed the title fix: resolve --lease-file under --state-dir fix: teardown removes the lease file the daemon writes Sep 3, 2026
@CMGS

CMGS commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the rebuilt branch in #20, which sits on the current main.

@CMGS CMGS closed this Sep 3, 2026
@CMGS
CMGS deleted the fix/lease-path-under-state-dir branch September 3, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant