Skip to content

Add describe-by selector for resources with ID and NAME columns - #25

Merged
clobrano merged 1 commit into
mainfrom
claude/gracious-einstein-ju9c4o
Sep 9, 2026
Merged

clobrano merged 1 commit into
mainfrom
claude/gracious-einstein-ju9c4o

Conversation

@clobrano

@clobrano clobrano commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

When describing Kubernetes resources that have both ID and NAME columns, users are now prompted to choose which identifier to use for the describe operation. This provides flexibility for resources where both identifiers are available.

Key Changes

  • Added currentTabHasIDAndName() method to detect when a resource table has both ID and NAME columns
  • Added openDescribeBySelector() to display a dialog asking users to choose between "Name" or "ID" for describing resources
  • Refactored getSelectedResourceInfo() into a more flexible getSelectedResourceInfoBy(idColumn) that accepts a column parameter, with the original method now delegating to it
  • Updated describeResources() to accept an idColumn parameter specifying which column provides the resource identifier
  • Added handling for the "describe-by" selector result in handleSelectorResult() to trigger the describe operation with the user's choice
  • Added comprehensive test coverage in app_test.go for the new functionality, including edge cases like nil resources and case-insensitive column matching

Implementation Details

  • The describe flow now checks if both ID and NAME columns exist before prompting; if only one exists, it proceeds directly with the describe operation as before
  • The selector defaults to NAME column when the idColumn parameter is empty, maintaining backward compatibility
  • Namespace detection continues to work correctly when present in the table

https://claude.ai/code/session_011DhepXnDKGecoNaYYnKgWQ

When the current tab's table has both an ID and a NAME column, pressing
'd' now opens a selector asking whether to describe the selected
resource(s) by Name or by ID, then runs kubectl describe using the
chosen identifier. Tabs that show only one of the two (the common case)
are unchanged and describe immediately by NAME.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DhepXnDKGecoNaYYnKgWQ
@clobrano
clobrano merged commit e9dd66e into main Sep 9, 2026
2 of 3 checks passed
@clobrano
clobrano deleted the claude/gracious-einstein-ju9c4o branch September 9, 2026 12:58
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.

2 participants