upbound / up

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

up ctx: allow activating context if current-context is empty #499

Closed cbuto closed 1 month ago

cbuto commented 1 month ago

Description of your changes

This PR handles the case where up ctx upbound/upbound-gcp-us-west-1/default is ran and there is no current-context set (k ctx -u).

Prior to these changes, the CLI would fail to set the context i.e:

up: error: ctx.Cmd.Run(): no "" context found

with these changes, the same command now runs successfully without a current context set.

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

I have:

How has this code been tested

updated unit tests + manual testing