Skip to content

Offer to delete leftover hibernation snapshot on droplet destroy#49

Merged
ret2libc merged 2 commits intotrailofbits:mainfrom
VariousForks:destroy-cleanup-snapshots
Mar 23, 2026
Merged

Offer to delete leftover hibernation snapshot on droplet destroy#49
ret2libc merged 2 commits intotrailofbits:mainfrom
VariousForks:destroy-cleanup-snapshots

Conversation

@gwpl
Copy link
Contributor

@gwpl gwpl commented Mar 21, 2026

Summary

AI Agent with Greg: We noticed that orphaned snapshots were quietly accumulating like digital dust bunnies — time for some spring cleaning! 🧹

  • After destroying a droplet, check for a matching dropkit-<name> hibernation snapshot
  • If found, display its name and size, and prompt the user to delete it
  • Defaults to "yes" to make cleanup easy, but the user can decline to keep the snapshot

Problem: hibernatewakeup (decline snapshot deletion) → destroy left the snapshot behind silently, incurring storage costs with no indication to the user.

Test plan

  • uv run ruff check dropkit/main.py — all checks passed
  • uv run ruff format --check dropkit/main.py — already formatted
  • uv run ty check dropkit/main.py — all checks passed
  • uv run pytest tests/ -v — 288 tests passed, 31% coverage (above 29% minimum)
  • Manual test: dropkit hibernate <name>dropkit wakeup <name> (decline snapshot delete) → dropkit destroy <name> — verify snapshot prompt appears
  • Manual test: dropkit destroy <name> on a droplet with no snapshot — verify no extra prompt

🤖 Generated with Claude Code

When a user hibernates a droplet then wakes it up but declines to delete
the snapshot, the snapshot is left behind. If they later `dropkit destroy`
the droplet, the orphaned snapshot persists silently, incurring storage
costs. After destroying the droplet, check for a matching hibernation
snapshot and prompt the user to delete it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gwpl gwpl requested a review from ret2libc as a code owner March 21, 2026 22:59
@CLAassistant
Copy link

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

Respect the user's earlier choice: if they declined to delete the
snapshot during wakeup, defaulting to 'yes' here would second-guess
that decision. Default to 'no' so the prompt is informational rather
than presumptive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ret2libc ret2libc merged commit b4df5c9 into trailofbits:main Mar 23, 2026
4 checks passed
@gwpl gwpl deleted the destroy-cleanup-snapshots branch March 23, 2026 20:42
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.

3 participants