If not able to connect to a cluster, or spaces does not exist on a cluster, the client will print an error to stderr.
$ ./up version
unable to get crossplane version. Is your kubecontext pointed at a control plane?
unable to get spaces version. Is your kubecontext pointed at a Space?
Client:
Version: v0.30.0-rc.0.18.gcbb90cc.dirty
Go Version: go1.22.1
Git Commit: cbb90cc
OS/Arch: darwin/arm64
Server:
Crossplane Version: unknown
Spaces Controller Version: unknown
Also now supports JSON and YAML output:
$ ./up version --format=json
unable to get spaces version. Is your kubecontext pointed at a Space?
{
"client": {
"arch": "arm64",
"gitCommit": "cbb90cc",
"goVersion": "go1.22.1",
"os": "darwin",
"version": "v0.30.0-rc.0.18.gcbb90cc.dirty"
},
"server": {
"crossplaneVersion": "v1.14.8-up.1",
"spacesControllerVersion": "Upbound Cloud Managed"
}
}
Description of your changes
Fixes https://github.com/upbound/up/issues/504
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
When connected to a cloud space, where you are not allowed to query for the spaces controller version,
up version
returns the following response:If not able to connect to a cluster, or spaces does not exist on a cluster, the client will print an error to stderr.
Also now supports JSON and YAML output: