Skip to content

Add Namespace viewer for OpenShift Projects in registrar #2265

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

zkck
Copy link
Contributor

@zkck zkck commented Oct 28, 2023

Closes #2224

Adding OpenShift Projects to the registrar, so that its view behaves like Namespaces. This great codebase made this easy, thanks for this great tool!

@derailed derailed added enhancement New feature or request needs-review PR needs to be reviewed labels Nov 12, 2023
Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zkck Thank you for your kind words Zak!
I am not super versed in Openshift.
From what I know projects are like k8s ns with extra annotations??
Is this correct?
My concern here is if reusing ns views for this could yield headaches further down stream...

@zkck
Copy link
Contributor Author

zkck commented Nov 22, 2023

Hi @derailed

Thanks for your review!

OpenShift Projects are explained as an "alternate representation for a Kubernetes namespace", and is used in OpenShift to isolate members into different collaboration groups. When you create a Project in OpenShift, a Namespace then exists with the same name as the Project.

The reason for my PR is because people working in OpenShift do not generally have access to list Namespaces across the cluster, but they have the permissions to list Projects, which lists the Projects that the user has access to. So switching Projects is tedious, since setting the Project requires leaving k9s, listing/setting the Project with the OpenShift CLI (oc). This PR would allow to stay inside k9s.

In terms of whether or not this would cause issues down the line, IMO the fact that a Project is just OpenShift's abstraction of Namespaces and that they both share the exact same resource name gives us a lot of guarantees.

Another link: https://docs.openshift.com/container-platform/4.14/applications/projects/working-with-projects.html

@slimus
Copy link
Contributor

slimus commented Nov 25, 2023

I have 2 openshift clusters, I can test this pull request.

@zkck
Copy link
Contributor Author

zkck commented Nov 25, 2023

Thanks @slimus 😄

Just a quick note, I tested this locally with OpenShift Local, and for me :projects listed another CR by default (from config.openshift.io/v1), so you may need to use the full :project.openshift.io/v1/projects or add aliases for it. Hope this helps 👍

@LennartRoeder
Copy link

Hi @zkck thanks for the PR.
Any update on when this will be merged and added to the next release?
I would highly appreciate this feature, because change projects is really the most annoying part about k9s. I always quit the tool, type oc project <myProject> and start k9s back up and I do this like 50 times per day.

@aellwein
Copy link

Also very interested in this feature, this would be a great time saver...

@aellwein
Copy link

@derailed any change to get this one reviewed and merged?

@zkck zkck force-pushed the feature/openshift-projects-namespace-viewer branch from 14d1126 to b49a876 Compare February 16, 2025 22:04
@zkck zkck force-pushed the feature/openshift-projects-namespace-viewer branch from b49a876 to 2f50c51 Compare February 16, 2025 22:25
@bismip
Copy link

bismip commented Mar 31, 2025

@derailed Can you please merge this?

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

Successfully merging this pull request may close these issues.

Support for switching between OpenShift Projects
6 participants