Skip to content

Commit

Permalink
Merge pull request #267 from MikeSpreitzer/more-deets
Browse files Browse the repository at this point in the history
✨ Slightly more informative messages
  • Loading branch information
pdettori authored May 29, 2024
2 parents 3ff4a1c + 6584cb8 commit 72af273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/kflex/ctx/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *CPCtx) Context(chattyStatus, failIfNone bool) {
ctxName := certs.GenerateContextName(c.Name)
util.PrintStatus(fmt.Sprintf("Switching to context %s...", ctxName), done, &wg, chattyStatus)
if err = kubeconfig.SwitchContext(kconf, c.Name); err != nil {
fmt.Fprintf(os.Stderr, "kubeconfig context %s not found, trying to load from server...\n", c.Name)
fmt.Fprintf(os.Stderr, "kubeconfig context %s not found (%s), trying to load from server...\n", c.Name, err)
if err := c.switchToHostingClusterContextAndWrite(kconf); err != nil {
fmt.Fprintf(os.Stderr, "Error switching back to hosting cluster context: %s\n", err)
os.Exit(1)
Expand All @@ -92,7 +92,7 @@ func (c *CPCtx) Context(chattyStatus, failIfNone bool) {
os.Exit(1)
}
} else {
fmt.Fprintf(os.Stderr, "control plane %s is of type 'host', using hosting cluster context\n", c.Name)
fmt.Fprintf(os.Stderr, "control plane %s is of type 'host', using hosting cluster context (%s)\n", c.Name, kconf.CurrentContext)
os.Exit(0)
}
}
Expand Down

0 comments on commit 72af273

Please sign in to comment.