diff --git a/internal/client/client.go b/internal/client/client.go index e43a561aa6..50a1f79e62 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -545,7 +545,10 @@ func (a *APIClient) SwitchContext(name string) error { if err := a.config.SwitchContext(name); err != nil { return err } - if err := a.invalidateCache(); err != nil { + + if !a.CheckConnectivity() { + log.Debug().Msg("No connectivity, skipping cache invalidation") + } else if err := a.invalidateCache(); err != nil { return err } a.reset()