ahmetb / kubectl-tree

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

Command reports ambiguous kind that's not ambiguous #64

Closed makkes closed 8 months ago

makkes commented 9 months 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 9 months 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 9 months 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 9 months ago

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

makkes commented 9 months ago

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

Absolutely, yes.