From fe4e05b0bcba5ecbccc17ffbb0e341caef6b9886 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 25 Oct 2022 09:24:05 +0200 Subject: [PATCH] only print stdout on err Signed-off-by: Kristoffer Dalby --- integration/tsic/tsic.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/tsic/tsic.go b/integration/tsic/tsic.go index b748245..14c627d 100644 --- a/integration/tsic/tsic.go +++ b/integration/tsic/tsic.go @@ -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 }