Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Fix 003-routeretry.patch patch (#407)
Browse files Browse the repository at this point in the history
This patch fixes the 003-routeretry.patch which is currently failing.
#406 verified this fix.
  • Loading branch information
nak3 authored Mar 3, 2020
1 parent d3a0876 commit f2a9731
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions openshift/patches/003-routeretry.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/test/v1/route.go b/test/v1/route.go
index 9c9a89034..353cbb3b4 100644
index 11026ffdc..b48db35f6 100644
--- a/test/v1/route.go
+++ b/test/v1/route.go
@@ -19,6 +19,7 @@ package v1
Expand All @@ -8,9 +8,9 @@ index 9c9a89034..353cbb3b4 100644
"fmt"
+ "net/http"

"github.com/davecgh/go-spew/spew"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -116,8 +117,13 @@ func IsRouteNotReady(r *v1.Route) (bool, error) {
"k8s.io/apimachinery/pkg/util/wait"
@@ -115,8 +116,13 @@ func IsRouteNotReady(r *v1.Route) (bool, error) {
}

// RetryingRouteInconsistency retries common requests seen when creating a new route
Expand All @@ -25,7 +25,7 @@ index 9c9a89034..353cbb3b4 100644
return innerCheck(resp)
}
diff --git a/test/v1alpha1/route.go b/test/v1alpha1/route.go
index ead307fcb..1431d2ef0 100644
index 87406b63e..ce6e6cc86 100644
--- a/test/v1alpha1/route.go
+++ b/test/v1alpha1/route.go
@@ -21,6 +21,7 @@ package v1alpha1
Expand All @@ -34,9 +34,9 @@ index ead307fcb..1431d2ef0 100644
"fmt"
+ "net/http"

"github.com/davecgh/go-spew/spew"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -51,9 +52,13 @@ func CreateRoute(t pkgTest.T, clients *test.Clients, names test.ResourceNames, f
"k8s.io/apimachinery/pkg/util/wait"
@@ -50,10 +51,14 @@ func CreateRoute(t pkgTest.T, clients *test.Clients, names test.ResourceNames, f
}

// RetryingRouteInconsistency retries common requests seen when creating a new route
Expand All @@ -45,14 +45,15 @@ index ead307fcb..1431d2ef0 100644
+// - 503 to account for Openshift route inconsistency (https://jira.coreos.com/browse/SRVKS-157)
func RetryingRouteInconsistency(innerCheck spoof.ResponseChecker) spoof.ResponseChecker {
return func(resp *spoof.Response) (bool, error) {
// If we didn't match any retryable codes, invoke the ResponseChecker that we wrapped.
+ if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusServiceUnavailable {
+ return false, nil
+ }
// If we didn't match any retryable codes, invoke the ResponseChecker that we wrapped.
return innerCheck(resp)
}
}
diff --git a/test/v1beta1/route.go b/test/v1beta1/route.go
index c9c47da64..31121302f 100644
index 119b4a818..1cbc802cb 100644
--- a/test/v1beta1/route.go
+++ b/test/v1beta1/route.go
@@ -19,6 +19,7 @@ package v1beta1
Expand All @@ -61,9 +62,9 @@ index c9c47da64..31121302f 100644
"fmt"
+ "net/http"

"github.com/davecgh/go-spew/spew"

@@ -118,8 +119,13 @@ func IsRouteNotReady(r *v1beta1.Route) (bool, error) {
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
@@ -116,8 +117,13 @@ func IsRouteNotReady(r *v1beta1.Route) (bool, error) {
}

// RetryingRouteInconsistency retries common requests seen when creating a new route
Expand Down

0 comments on commit f2a9731

Please sign in to comment.