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

Add namespace name in ServiceAccount view with RoleBinding #2169

Closed
vladfr opened this issue Jul 24, 2023 · 1 comment · Fixed by #2170
Closed

Add namespace name in ServiceAccount view with RoleBinding #2169

vladfr opened this issue Jul 24, 2023 · 1 comment · Fixed by #2170

Comments

@vladfr
Copy link
Contributor

vladfr commented Jul 24, 2023




Describe the bug
In the ServiceAccount view (hit ENTER) you see NAMESPACE "*" for a ClusterRole bound with a RoleBinding.

To Reproduce
Steps to reproduce the behavior:

  1. Get a default kind cluster
  2. Create a RoleBinding for the built-in CR:View ClusterRole
kubectl create rolebinding view \
  --clusterrole=view \
  --serviceaccount=default:default \
  --namespace=default
  1. Open k9s and search for :serviceaccount. Find default:default and hit Enter.
  2. See the list of RBACs, see that the Namespace column has *, when in fact it should have default.

Expected behavior
The NAMESPACE column should have the namespace that was used in the RoleBinding.

Versions (please complete the following information):

  • OS: OSX
  • K9s: 0.27.4
  • K8s: 1.27.3 kind

Additional context
Even though this is a ClusterRole, because it's bound using a RoleBinding, it only gives permissions to resources from a namespace. When debugging RBAC, this can be confusing.

@vladfr
Copy link
Contributor Author

vladfr commented Jul 24, 2023

If it makes sense to fix this, I would absolutely like to submit a PR as well. It would be my first contribution to k9s so it's why I'm starting with opening an issue.

edit: well this turned out to be an easy fix. Check out the PR! 🌞

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 a pull request may close this issue.

1 participant