Skip to content

Commit

Permalink
Add hack to refetch whoami on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 12, 2024
1 parent 1179d0d commit a68524b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/bbctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path"
"strings"
"time"

"github.com/fatih/color"
Expand Down Expand Up @@ -82,7 +83,7 @@ func prepareApp(ctx *cli.Context) error {
ctx.Context = context.WithValue(ctx.Context, contextKeyConfig, cfg)
ctx.Context = context.WithValue(ctx.Context, contextKeyEnvConfig, envConfig)
if envConfig.HasCredentials() {
if envConfig.HungryAddress == "" || envConfig.ClusterID == "" || envConfig.Username == "" {
if envConfig.HungryAddress == "" || envConfig.ClusterID == "" || envConfig.Username == "" || !strings.Contains(envConfig.HungryAddress, "/_hungryserv") {
log.Printf("Fetching whoami to fill missing env config details")
_, err = getCachedWhoami(ctx)
if err != nil {
Expand Down

0 comments on commit a68524b

Please sign in to comment.