Skip to content

Commit

Permalink
Evanulate if cache daemon should be skipped after the flags are parsed (
Browse files Browse the repository at this point in the history
  • Loading branch information
talanknight authored Dec 18, 2023
1 parent 60c5e53 commit 91e4578
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/clientcache/cmd/daemon/command_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ func Wrap(c cacheEnabledCommand) cli.CommandFactory {
// Run runs the wrapped command and then attempts to start the boundary daemon and send
// the current persona
func (w *CommandWrapper) Run(args []string) int {
if w.BaseCommand().FlagSkipCacheDaemon {
return w.cacheEnabledCommand.Run(args)
}

// potentially intercept the token in case it isn't stored in the keyring
var token string
w.cacheEnabledCommand.BaseCommand().Opts = append(w.cacheEnabledCommand.BaseCommand().Opts, base.WithInterceptedToken(&token))
r := w.cacheEnabledCommand.Run(args)
if w.BaseCommand().FlagSkipCacheDaemon {
return r
}

if r != base.CommandSuccess {
// if we were not successful in running our command, do not continue to
Expand Down

0 comments on commit 91e4578

Please sign in to comment.