Add Namespace viewer for OpenShift Projects in registrar
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!
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
I have 2 openshift clusters, I can test this pull request.
Thanks @slimus :smile:
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 :+1:
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.