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

Open controller shortcut #1747

Closed
sralloza opened this issue Sep 7, 2022 · 8 comments
Closed

Open controller shortcut #1747

sralloza opened this issue Sep 7, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@sralloza
Copy link

sralloza commented Sep 7, 2022

In the pods view I usually want to open the controller of a specific pod (ReplicaSet -> Deployment, for example) and then restart the deployment, without navigating to the deployments view, filter them out and selecting the one I need.

It would be awesome if k9s supported this with a shortcut.

@derailed derailed added the enhancement New feature or request label Sep 15, 2022
@caproven
Copy link
Contributor

Agreed this could be a nifty feature. Should be relatively simple to determine - look up the resource's owner references and iterate to find an entry with controller: true. Edge cases would be

  • resource lacks owner references -> no-op
  • has owner references but no controller -> no-op

@sralloza you mention pods but I don't see a reason to limit the feature to a particular resource. It would be useful to navigate "upward" from any resource, such as Pod -> ReplicaSet, EndpointSlice -> Service, or PVC -> PV.

I'm not familiar enough with the codebase to say how this would be implemented, but I can dig a little to gauge complexity.

@caproven
Copy link
Contributor

Believe this is definitely doable. As predicted finding the controller resource is straightforward. The tricky part then seems to be changing the view to display the resource. In cases like hitting Enter on a Deployment, the selector is used to lookup Pods. That won't work here as we want to display only the controller resource, regardless of selectors.

gitolicious added a commit to gitolicious/k9s that referenced this issue Jun 15, 2023
@gitolicious
Copy link
Contributor

I gave it a shot with #2133, let me know what you think.

@Richard87
Copy link

I was just looking for this feature! Also completley new to k9s, but would it be possible to jump to any kind of resource?

I often find myself going to the owning custom resource, like cert-manager certificates/challenges/orders etc, or CloudNative-PGs PostgresCluster (owns the pod) etc...

@gitolicious
Copy link
Contributor

but would it be possible to jump to any kind of resource?

See my comment in the PR. I didn't find an easy way on first try. But it should be possible.

gitolicious added a commit to gitolicious/k9s that referenced this issue Nov 12, 2023
gitolicious added a commit to gitolicious/k9s that referenced this issue Nov 12, 2023
gitolicious added a commit to gitolicious/k9s that referenced this issue Jan 1, 2024
gitolicious added a commit to gitolicious/k9s that referenced this issue Jan 19, 2024
gitolicious added a commit to gitolicious/k9s that referenced this issue Feb 18, 2024
gitolicious added a commit to gitolicious/k9s that referenced this issue Apr 22, 2024
gitolicious added a commit to gitolicious/k9s that referenced this issue May 7, 2024
@gitolicious
Copy link
Contributor

Duplicated by #2696 and solved with the merge of #2700.

@sralloza
Copy link
Author

Implemented in #2700 (release v0.32.5)

@rrmistry
Copy link

rrmistry commented Dec 2, 2024

In case anyone else lands here and can't find the shortcut: <shift-j> Jump Owner

Also, this shortcut is only available in the resource list view, not the resource's Describe or YAML views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants