ahmetb / kubectl-tree

kubectl plugin to browse Kubernetes object hierarchies as a tree 🎄 (star the repo if you are using)
Apache License 2.0
3.01k stars 127 forks source link

Support cluster-scoped resource #27

Closed ryysud closed 4 years ago

ryysud commented 4 years ago

This PR fixes https://github.com/ahmetb/kubectl-tree/issues/26 .

Output after applying this change.

$ kubectl tree samples sample -A
NAMESPACE     NAME                               READY  REASON  AGE
              Sample/sample                -              112s
              ├─ClusterRole/sample         -              111s
              ├─ClusterRoleBinding/sample  -              111s
test          └─ServiceAccount/sample      -              112s
ahmetb commented 4 years ago

Thanks. Did adding this fix the problem?

ryysud commented 4 years ago

Yes.

Before:

# Sample is the custom resource
$ kubectl api-resources
NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND
samples                                        sample.example.org             false        Sample

$ kubectl tree samples sample -A
Error: failed to get samples/sample: the server could not find the requested resource

After:

$ kubectl tree samples sample -A
NAMESPACE     NAME                               READY  REASON  AGE
              Sample/sample                -              112s
              ├─ClusterRole/sample         -              111s
              ├─ClusterRoleBinding/sample  -              111s
test          └─ServiceAccount/sample      -              112s
ahmetb commented 4 years ago

I see two different users authored the commit. Are them both you?

ryysud commented 4 years ago

No, this patch was created by co-worker @tatsuhiro-t and I commited it.

ahmetb commented 4 years ago

I just made v0.4.0 release with this if you need it.

ryysud commented 4 years ago

Thank you!