Skip to content

feat: Add context deletion functionality #3489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alextricity25
Copy link

Summary

  • Add ability to delete Kubernetes contexts directly from K9s UI
  • Implement context deletion with confirmation dialog
  • Follow existing UI patterns for consistency

Changes Made

  • Added D key binding to context view for delete functionality
  • Created deleteCmd() handler following existing patterns
  • Implemented showDeleteConfirmation() dialog with OK/Cancel buttons
  • Added deleteDialogCallback() that leverages existing DelContext() method
  • Updated test to account for new hint count

Usage

  1. Navigate to contexts view (:ctx command)
  2. Select a context with arrow keys
  3. Press D to delete
  4. Confirm deletion in the dialog

Test Plan

  • All existing tests continue to pass
  • Updated context test for new hint count
  • Manual testing of delete functionality
  • Confirmation dialog works as expected
  • Error handling displays properly via flash messages

This adds the ability to delete Kubernetes contexts using the 'd' key in the context view. The implementation includes:
- New delete command bound to 'd' key
- Confirmation dialog before deletion
- Error handling and UI refresh after deletion
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