Skip to content
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

Feature: goto owner (ctrl-o) #2640

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

Conversation

bnu0
Copy link

@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
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
Contributor

Superseded by the merge of #2700.

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.

None yet

2 participants