Skip to content

feat(cli): add --prune option to sandbox delete command - #3378

Open
engelmi wants to merge 1 commit into
NVIDIA:mainfrom
engelmi:add-delete-prune-option
Open

engelmi wants to merge 1 commit into
NVIDIA:mainfrom
engelmi:add-delete-prune-option

Conversation

@engelmi

@engelmi engelmi commented Sep 16, 2026 •

Copy link
Copy Markdown

Summary

Add a --prune flag to openshell sandbox delete that deletes only inactive sandboxes. This allows users to clean up terminated, stopped, or errored sandboxes while preserving active and provisioning ones.

The prune filter targets sandboxes in these (inactive) phases:

  • Error
  • Completed

Sandboxes in unconfirmed or non-terminal states are preserved.

The flag conflicts with both --all and named sandbox arguments, ensuring clear deletion intent.

Related Issue

Fixes: #2594

Changes

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
    - [ ] E2E tests added/updated (if applicable) (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
    - [] Architecture docs updated (if applicable) (not applicable)

@copy-pr-bot

copy-pr-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@sjenning

Copy link
Copy Markdown
Collaborator

I think we just want to prune sandboxes in confirmed terminal states. That is Errror or Completed. All the other states could be transient and/or non-terminal (e.g. stopped sandboxes can be restarted).

@engelmi
engelmi force-pushed the add-delete-prune-option branch from e0c79cd to d0ef037 Compare September 18, 2026 06:41
@engelmi

engelmi commented Sep 18, 2026

Copy link
Copy Markdown
Author

I think we just want to prune sandboxes in confirmed terminal states. That is Errror or Completed. All the other states could be transient and/or non-terminal (e.g. stopped sandboxes can be restarted).

Agreed. I pushed the changes. PTAL @sjenning

@sjenning

Copy link
Copy Markdown
Collaborator

/ok to test d0ef037

@engelmi
engelmi force-pushed the add-delete-prune-option branch 2 times, most recently from 9362ae8 to c2ed632 Compare September 22, 2026 07:33
@engelmi

engelmi commented Sep 22, 2026

Copy link
Copy Markdown
Author

@sjenning I had to rebase. Could you trigger the CI again?

@engelmi
engelmi force-pushed the add-delete-prune-option branch from c2ed632 to a2579c7 Compare September 29, 2026 07:15

@ericcurtin ericcurtin 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.

FWIW (not that it's worth much), LGTM

Add a --prune flag to `openshell sandbox delete` that deletes only
inactive sandboxes. This allows users to clean up terminated, stopped,
or errored sandboxes while preserving active and provisioning ones.

The prune filter targets sandboxes in these phases:
- Unspecified
- Unknown
- Error
- Deleting
- Stopped
- Completed

Active sandboxes (Ready, Provisioning, Starting) are preserved.

The flag conflicts with both --all and named sandbox arguments,
ensuring clear deletion intent.

Fixes: NVIDIA#2594

Signed-off-by: Michael Engel <mengel@redhat.com>
@engelmi
engelmi force-pushed the add-delete-prune-option branch from a2579c7 to 9f33ea4 Compare September 30, 2026 15:05

This branch has not been deployed

No deployments
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.

feat(cli): add sandbox prune command to delete ERROR-phase sandboxes

3 participants