Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type Runner struct {
runtimeManager engine.RuntimeManager
ports engine.Ports
credCtx string
credMutex sync.Mutex
}

func New(client engine.Model, credCtx string, opts ...Options) (*Runner, error) {
Expand All @@ -71,6 +72,7 @@ func New(client engine.Model, credCtx string, opts ...Options) (*Runner, error)
factory: opt.MonitorFactory,
runtimeManager: opt.RuntimeManager,
credCtx: credCtx,
credMutex: sync.Mutex{},
}

if opt.StartPort != 0 {
Expand Down Expand Up @@ -330,6 +332,10 @@ func recordStateMessage(state *engine.State) error {
}

func (r *Runner) handleCredentials(callCtx engine.Context, monitor Monitor, env []string) ([]string, error) {
// Since credential tools (usually) prompt the user, we want to only run one at a time.
r.credMutex.Lock()
defer r.credMutex.Unlock()

c, err := config.ReadCLIConfig("")
if err != nil {
return nil, fmt.Errorf("failed to read CLI config: %w", err)
Expand Down