fix(scripts): recognize linuxbrew volumes in the orphaned-volume cleanup sweep - #187
Merged
Conversation
…nup sweep cleanup-deleted-workspaces.sh's orphan detection only matched coder-<owner>-<workspace>-dind-cache. An upcoming change persists Homebrew across workspace restarts via a second per-workspace volume (coder-<owner>-<workspace>-linuxbrew) -- without this fix, an orphaned one (from an interrupted destroy, state desync, etc. -- exactly the failure modes this script is a safety net for) would never be flagged or cleaned up. Match both known suffixes, and note in-line that any future persistent per-workspace volume needs to be added here too. Also tightens a comment in workspace-lifecycle-cleanup.sh that attributed volume cleanup to "the destroy provisioner" -- the null_resource destroy provisioner in each template only removes the host-bind-mounted directory; volumes are removed because Terraform destroys them along with the rest of the workspace's resource graph, which is a separate mechanism. Updated to mention the linuxbrew volume too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cleanup-deleted-workspaces.shonly matched the-dind-cachevolume suffix, so an orphaned-linuxbrewvolume (from an interrupted destroy, state desync, etc.) would never be flagged for cleanup.^coder-(.+)-(dind-cache|linuxbrew)$, with an inline comment reminding future maintainers to extend the alternation for any new persistent per-workspace volume type.workspace-lifecycle-cleanup.sh: volumes are removed because Terraform destroys them along with the rest of the workspace's resource graph, not by "the destroy provisioner" (a separate, narrower mechanism that only handles the host-bind-mounted/home/coderdirectory) — and mentions the linuxbrew volume.Test plan
bash -nsyntax check on both scriptsterraform fmt/validate/testneeded-linuxbrewvolume in production (requires a real Coder deployment with an orphaned volume present)Note: both scripts are installed manually on
coder.ddev.com— merging this PR alone doesn't update the live copy; the server-side script needs a manual refresh too.🤖 Generated with Claude Code