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.
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:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.~How has this code been tested
This can be tested locally by running the following setup: