upbound / up

The @upbound CLI
Apache License 2.0
49 stars 42 forks source link

Fix condition where current context points nowhere #518

Closed RedbackThomson closed 1 month ago

RedbackThomson commented 1 month ago

Description of your changes

Fixes https://github.com/upbound/up/issues/513

Since we no longer depend on a valid current context, I thought the message that was output when a user switches contexts didn't make sense anymore. It was sometimes even showing Kubeconfig context "" switched to: ... which just feels like a mistake. So this PR also updates the output for a successful save and quit to be:

$ ./up ctx ./ctp1
Switched kubeconfig context to: Upbound upbound/upbound-aws-us-east-1/default/ctp1

The plan is to eventually rename the exported context to include the group and ctp name, so we would show that instead of the breadcrumbs. But at least this describes that we're adding a new context.

I have:

How has this code been tested