Skip to content

Commit

Permalink
Add fail fast to DumpResourcesForCluster in case of no route to host
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Feb 27, 2024
1 parent 0f47a19 commit 05b0f2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/framework/alltypes_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path"
"path/filepath"
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -158,6 +159,12 @@ func DumpResourcesForCluster(ctx context.Context, input DumpResourcesForClusterI
var listErr error
_ = wait.PollUntilContextTimeout(ctx, retryableOperationInterval, retryableOperationTimeout, true, func(ctx context.Context) (bool, error) {
if listErr = input.Lister.List(ctx, resourceList, client.InNamespace(resource.Namespace)); listErr != nil {
// Fail fast for well know network errors that most likely won't recover.
// e.g This error happens when the control plane endpoint for the workload cluster can't be reached from
// the machine where the E2E test runs.
if strings.HasSuffix(listErr.Error(), "connect: no route to host") {
return true, nil
}
return false, nil //nolint:nilerr

Check failure on line 168 in test/framework/alltypes_helpers.go

View workflow job for this annotation

GitHub Actions / lint (test)

directive `//nolint:nilerr` is unused for linter "nilerr" (nolintlint)

Check failure on line 168 in test/framework/alltypes_helpers.go

View workflow job for this annotation

GitHub Actions / lint (test)

directive `//nolint:nilerr` is unused for linter "nilerr" (nolintlint)
}
return true, nil
Expand Down

0 comments on commit 05b0f2b

Please sign in to comment.