From 27f689959decd391b047c8034d481267d500549e Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 15 May 2025 15:01:02 +0200 Subject: vm: func Run accepts context It allows to use context as a single termination signal source. --- vm/gce/gce.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vm/gce') diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 0da3781ba..568eab582 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -271,7 +271,7 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( +func (inst *instance) Run(ctx context.Context, command string) ( <-chan []byte, <-chan error, error) { conRpipe, conWpipe, err := osutil.LongPipe() if err != nil { @@ -340,9 +340,8 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin sshWpipe.Close() merger.Add("ssh", sshRpipe) - return vmimpl.Multiplex(ssh, merger, timeout, vmimpl.MultiplexConfig{ + return vmimpl.Multiplex(ctx, ssh, merger, vmimpl.MultiplexConfig{ Console: vmimpl.CmdCloser{Cmd: con}, - Stop: stop, Close: inst.closed, Debug: inst.debug, Scale: inst.timeouts.Scale, -- cgit mrf-deployment