upbound / up

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

`up ctx` fails to grab a context when no kubecontext is set #513

Closed cwilhit closed 1 month ago

cwilhit commented 1 month ago

What happened?

Follow Console instructions for grabbing the kubeconfig of a control plane, i.e.:

up ctx acmeco/upbound-gcp-us-west-1/default/ctp1

It fails saying "up: error: ctx.Cmd.Run(): no "upbound" context found"

How can we reproduce it?

kubectl config delete-context upbound
up ctx acmeco/upbound-gcp-us-west-1/default/ctp1

What environment did it happen in?

Prod with Client Version: v0.30.0-rc.0.16.gd077815

RedbackThomson commented 1 month ago

After deleting the upbound context, the current-context in the Kubeconfig was pointing at a non-existent context. When running, up ctx tried to resolve current-context and fell over because it couldn't be found. Ideally we should treat cases where the current-context doesn't resolve to anything the same way as we treat an empty current-context.