Previously, there were two issues preventing Spaces initialized via up space init (with its default arguments) from being attached to the console:
The account name could only be set by explicitly providing helm parameter flags (--set or --file). The --account flag and the account in the active profile were both ignored, resulting in spaces being created with the confusing default account name notdemo.
The check in up space attach was taking the current account name only from the --account parameter, rather than using the existing machinery that takes it from the active profile in the config file when necessary.
This PR introduces two fixes for these issues:
Update the space init code to fall back to the account in the upbound context object, which will be initialized appropriately based on --account and the config file. Let the helm parameters take precedence if they're given, since they're more specific.
Use the account name from the upbound context in up space attach, which should alwyas be populated appropriately.
While we're here, change the default account name to disconnected. This is at least a bit more meaningful than notdemo, since Spaces created without a valid account name can only be used as disconnected spaces (can't be attached to the console). Also warn users before using the default, since Spaces initialized this way can't be attached to the console and we assume most users will want that eventually.
[x] Run make reviewable to ensure this PR is ready for review.
[ ] Added backport release-x.y labels to auto-backport this PR, as appropriate.
How has this code been tested
Manually tested the up space init -> up space attach flow while logged in (profile set) and without a .up/config.json file (to trigger the new warning).
Description of your changes
Previously, there were two issues preventing Spaces initialized via
up space init
(with its default arguments) from being attached to the console:--set
or--file
). The--account
flag and the account in the active profile were both ignored, resulting in spaces being created with the confusing default account namenotdemo
.up space attach
was taking the current account name only from the--account
parameter, rather than using the existing machinery that takes it from the active profile in the config file when necessary.This PR introduces two fixes for these issues:
space init
code to fall back to the account in the upbound context object, which will be initialized appropriately based on--account
and the config file. Let the helm parameters take precedence if they're given, since they're more specific.up space attach
, which should alwyas be populated appropriately.While we're here, change the default account name to
disconnected
. This is at least a bit more meaningful thannotdemo
, since Spaces created without a valid account name can only be used as disconnected spaces (can't be attached to the console). Also warn users before using the default, since Spaces initialized this way can't be attached to the console and we assume most users will want that eventually.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
Manually tested the
up space init
->up space attach
flow while logged in (profile set) and without a.up/config.json
file (to trigger the new warning).