Prior to this changeset, if a user was not logged in to Upbound Cloud they would be presented with the following error when pointed at a disconnected space:
up: error: space.listCmd.Run(): failed to get Account "upbound": Unauthorized: {"message":"Unauthorized"}
Changes:
space list is for listing across spaces, which inherently doesn't work in isolation
update current logic that returns an error if you are not logged in to upbound cloud
add test coverage for the interactions
introduce NopPrinters so that we can test logic without needing to account for stdout comms
Description of your changes
Prior to this changeset, if a user was not logged in to Upbound Cloud they would be presented with the following error when pointed at a disconnected space:
Changes:
Relates to https://github.com/upbound/up/issues/487
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
New unit tests.
With a local build:
./_output/bin/darwin_arm64/up space list NAME MODE PROVIDER REGION upbound-legacy-gcp legacy gcp us-central-1 upbound-gcp-us-west-1 managed gcp us-west-1 upbound-aws-us-east-1 managed aws us-east-1 attached-gjsf9 connected attached-mmdmz connected borrelli-self-hosted connected bulat-kind-space connected erhan-test-space connected ezgi-space connected michael-test connected milo-space-2 connected milo-space-3 connected sumbrizzle connected
./_output/bin/darwin_arm64/up logout taylor logged out
./_output/bin/darwin_arm64/up space list You must be logged in and authorized to list Upbound Cloud Spaces