Skip to content

Commit

Permalink
Merge pull request #10204 from fabriziopandini/add-fail-fast-for-Dump…
Browse files Browse the repository at this point in the history
…ResourcesForCluster

 🌱 Add fail fast to DumpResourcesForCluster in case of no route to host
  • Loading branch information
k8s-ci-robot committed Feb 27, 2024
2 parents 6b361e4 + da574b3 commit 3afe641
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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,7 +159,13 @@ 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 {
return false, nil //nolint:nilerr
// Fail fast for well known 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
}
return true, nil
})
Expand Down

0 comments on commit 3afe641

Please sign in to comment.