aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce/gce.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-05-15 15:01:02 +0200
committerTaras Madan <tarasmadan@google.com>2025-05-19 09:39:47 +0000
commit27f689959decd391b047c8034d481267d500549e (patch)
tree79ce6364d592fd6841e25ec64ca645fc3c65cdcf /vm/gce/gce.go
parent8f9cf946b3733d0b4ad3124bce155a4fc3849c3a (diff)
vm: func Run accepts context
It allows to use context as a single termination signal source.
Diffstat (limited to 'vm/gce/gce.go')
-rw-r--r--vm/gce/gce.go5
1 files changed, 2 insertions, 3 deletions
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,