Skip to content

Feature: goto owner (ctrl-o)#2640

Closed
bnu0 wants to merge 1 commit intoderailed:masterfrom
bnu0:bnu-goto-owner
Closed

Feature: goto owner (ctrl-o)#2640
bnu0 wants to merge 1 commit intoderailed:masterfrom
bnu0:bnu-goto-owner

Conversation

@bnu0
Copy link
Copy Markdown

@bnu0 bnu0 commented Mar 22, 2024

TL;DR:

Allow traversing to the first resolvable ownerReference on any resource.

Pressing ctrl-o will switch to the view of the owner's resource type, and focus the cursor on the owner itself. The stack is preserved so esc will bring you back down to the child.

Confirmed to work for both cluster-scoped and namespaced resources (ownerReferences are not allowed to cross namespaces, namespaced resources must have namespaced owners in the same namespace, etc. etc.)

Nuances

  1. No effort was put into what to do in the case of multiple owners. This is exceedingly rare in the wild.
  2. The GVK -> GVR reverse mapping search is not optimal and holds the readlock. In most cluster(s) I'd expect this to be negligible (maybe a few hundred resource-versions at most?). Since the search happens on user input, it is not noticeable.

@gitolicious
Copy link
Copy Markdown
Contributor

There is an open issue #1747 for this feature. I gave it a shot in #2133 close to a year ago. Unfortunately, the PR is getting stale as @derailed seems to be too busy for a final review.

Anyways, interesting to see that you managed to implement in 50 lines what took me 240! 🤓

@gitolicious
Copy link
Copy Markdown
Contributor

Superseded by the merge of #2700.

@github-actions github-actions bot added the stale label Jul 17, 2025
@github-actions github-actions bot closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants