From 8a79c2e7ed662b926a2157b6d029a96fb86bd13f Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 21 Nov 2022 14:08:24 +0100 Subject: [PATCH] Do not retry on permission denied in ssh Signed-off-by: Kristoffer Dalby --- integration/ssh_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration/ssh_test.go b/integration/ssh_test.go index d480f8df..57d85980 100644 --- a/integration/ssh_test.go +++ b/integration/ssh_test.go @@ -28,6 +28,13 @@ var retry = func(times int, sleepInterval time.Duration, if err == nil { return result, stderr, nil } + + // If we get a permission denied error, we can fail immediately + // since that is something we wont recover from by retrying. + if err != nil && strings.Contains(stderr, "Permission denied (tailscale)") { + return result, stderr, err + } + time.Sleep(sleepInterval) }