Skip to content

Commit

Permalink
cmd/run: simplify err handling since guest client handles login
Browse files Browse the repository at this point in the history
  • Loading branch information
joshi4 committed Aug 23, 2024
1 parent 4e6d099 commit 6aa9775
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,7 @@ type selectableRunbook struct {
func allowUserToSelectRunbook(ctx context.Context, logger *slog.Logger, cl client.Client) (string, error) {
l := logger.With("func", "allowsUserToSelectRunbook")
runbooks, err := cl.Runbooks(ctx)
if errors.Is(err, client.ErrCannotUseGuest) {
runLogin()
cl, err = client.New()
if err != nil {
return "", err
}
runbooks, err = cl.Runbooks(ctx)
} else if err != nil {
if err != nil {
l.Debug("failed to fetch runbooks", "error", err)
return "", err
}
Expand Down

0 comments on commit 6aa9775

Please sign in to comment.