Skip to content

Commit 978c2c6

Browse files
authored
Tart executor: log failed "umount" output when using --dirty (#991)
1 parent f014e77 commit 978c2c6

File tree

1 file changed

+8
-0
lines changed
  • internal/executor/instance/persistentworker/isolation/tart

1 file changed

+8
-0
lines changed

internal/executor/instance/persistentworker/isolation/tart/hook.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package tart
22

33
import (
4+
"bytes"
45
"context"
56
"fmt"
7+
68
"github.com/cirruslabs/cirrus-cli/internal/executor/instance/persistentworker/remoteagent"
79
"github.com/cirruslabs/echelon"
810
"golang.org/x/crypto/ssh"
@@ -51,9 +53,15 @@ func unmountWorkingDirectoryHook(logger *echelon.Logger) remoteagent.WaitForAgen
5153
return err
5254
}
5355

56+
var stdout, stderr bytes.Buffer
57+
sshSess.Stdout = &stdout
58+
sshSess.Stderr = &stderr
59+
5460
if err := sshSess.Run(command); err != nil {
5561
_ = sshSess.Close()
5662

63+
syncLogger.Errorf("%s", firstNonEmptyLine(stderr.String(), stdout.String()))
64+
5765
syncLogger.Finish(false)
5866
return err
5967
}

0 commit comments

Comments
 (0)