upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

Make ctp list derive context from kubeconfig #457

Closed Piotr1215 closed 5 months ago

Piotr1215 commented 6 months ago

Description of your changes

This PR makes up ctp list kubeconfig context aware, making it independent from the current profile. The profile is automatically derived:

$ kubectl ctx not-space-kube $ up ctp list You are not on a space. $ kubectl ctx space $ up ctp list .... controlplanes from the profile matching the kubeconfig context's URL .... $ up ctp connect ctp $ up ctp list In a controlplane, you cannot list controlplanes. Use 'up ctx ..' to go to group level.

Fixes https://github.com/upbound/spaces/issues/752

NOTE: this breaks the use against a cloud profile. We will bring it back in a follow-up.

I have:

How has this code been tested

This can be tested locally by running the following setup: