loft-sh / loft

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode
https://loft.sh/docs/introduction
Other
737 stars 65 forks source link

`loft use vcluster` is difficult to use with a vcluster using a displayName #240

Closed willgorman closed 1 year ago

willgorman commented 1 year ago

If I have a vcluster that has a spec.displayName value that is different from metadata.name then it is confusing to know how to refer to that cluster with loft use vcluster. For example, with a vcluster with a metadata.name of my-vcluster and a spec.displayName of my-vcluster-with-displayName if I list the vclusters I see:

❯ loft list vclusters

 Name                           Project        Cluster        Namespace                         Status   Age
 my-vcluster-with-displayName   will-project   loft-cluster   loft-will-project-v-my-vcluster   Ready    84s

But loft use vcluster my-vcluster-with-displayName fails:

❯ loft use vcluster my-vcluster-with-displayName
[fatal]  couldn't find or access virtual cluster my-vcluster-with-displayName

This is confusing because the only thing I can see where the cli shows the metadata.name is in the suffix to the namespace but it's not obvious that loft use vcluster my-vcluster is necessary.

Would it be possible to either: