From 6f488d7c5929f196839db073067cb3206728ee31 Mon Sep 17 00:00:00 2001 From: Todd Date: Mon, 18 Dec 2023 08:03:52 -0800 Subject: [PATCH] Evanulate if cache daemon should be skipped after the flags are parsed (#4168) --- internal/clientcache/cmd/daemon/command_wrapper.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/clientcache/cmd/daemon/command_wrapper.go b/internal/clientcache/cmd/daemon/command_wrapper.go index fda2568c1d..9918ff54de 100644 --- a/internal/clientcache/cmd/daemon/command_wrapper.go +++ b/internal/clientcache/cmd/daemon/command_wrapper.go @@ -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