Problem
acloud config profile use switches credentials but leaves all saved contexts untouched.
Contexts store project IDs that belong to a specific tenant, so after switching to a different profile (e.g. from dev to prod) the saved project IDs are almost always invalid for the new tenant. The user then hits confusing 404 / permission errors on the first resource command.
Expected behaviour
When switching profiles, the CLI should offer to clear all saved contexts, because projects belong to a single tenant (profile). The user should be able to:
- Accept the prompt to clear contexts in interactive mode
- Pass
--clear-contexts to clear without a prompt in scripts/CI
- Decline the prompt (or run non-interactively) to keep contexts unchanged
Implemented behaviour
- Interactive:
Contexts may not be valid for the new profile. Clear all contexts? (y/N):
- Non-interactive (piped): silently keeps contexts (safe default)
--clear-contexts flag: always clears, no prompt
Fixed in #236.
Problem
acloud config profile useswitches credentials but leaves all saved contexts untouched.Contexts store project IDs that belong to a specific tenant, so after switching to a different profile (e.g. from
devtoprod) the saved project IDs are almost always invalid for the new tenant. The user then hits confusing 404 / permission errors on the first resource command.Expected behaviour
When switching profiles, the CLI should offer to clear all saved contexts, because projects belong to a single tenant (profile). The user should be able to:
--clear-contextsto clear without a prompt in scripts/CIImplemented behaviour
Contexts may not be valid for the new profile. Clear all contexts? (y/N):--clear-contextsflag: always clears, no promptFixed in #236.