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

Command reports ambiguous kind that's not ambiguous #64

Closed makkes closed 1 year ago

makkes commented 1 year ago
$ k tree kubegres my-db
Error: ambiguous kind "kubegres". use one of these as the KIND disambiguate: [kubegres.v1.kubegres.reactive-tech.io, kubegres.v1.kubegres.reactive-tech.io]

The two kinds listed are exactly the same.

makkes commented 1 year ago

This behaviour might be caused by the CRD using the same name for singular and plural:

$ k get crd kubegres.kubegres.reactive-tech.io -o jsonpath={.spec.names}|jq .
{
  "kind": "Kubegres",
  "listKind": "KubegresList",
  "plural": "kubegres",
  "singular": "kubegres"
}
makkes commented 1 year ago

Confirmed that #65 fixes this:

$ ./kubectl-tree kubegres.v1.kubegres.reactive-tech.io my-db
NAMESPACE  NAME                                            READY  REASON        AGE 
foo        Kubegres/my-db                                  -                    378d
foo        ├─CronJob/backup-my-db                          -                    304d
foo        │ ├─Job/backup-my-db-28291118                   -                    2d1h
[...]
ahmetb commented 1 year ago

Sounds like the kubegres project probably got something wrong here as well? :)

makkes commented 1 year ago

Sounds like the kubegres project probably got something wrong here as well? :)

Absolutely, yes.