only print stdout on err
@@ -121,6 +121,10 @@ func (t *TailscaleInContainer) Execute(
if err != nil {
log.Printf("command stderr: %s\n", stderr)
+ if stdout != "" {
+ log.Printf("command stdout: %s\n", stdout)
+ }
+
if strings.Contains(stderr, "NeedsLogin") {
return "", errTailscaleNotLoggedIn
}
@@ -128,10 +132,6 @@ func (t *TailscaleInContainer) Execute(
return "", err
}
- if stdout != "" {
- log.Printf("command stdout: %s\n", stdout)
- }
-
return stdout, nil
}
