Skip to content

Commit

Permalink
[k8s-support] - Tolerating exception in WaiterUtils::routeIsUp
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobrz committed Jul 17, 2023
1 parent 1e3cf90 commit 4d3c181
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.stream.Collectors;

import cz.xtf.core.http.Https;
import cz.xtf.core.http.HttpsException;
import cz.xtf.core.openshift.OpenShift;
import cz.xtf.core.waiting.SimpleWaiter;
import cz.xtf.core.waiting.Waiter;
Expand Down Expand Up @@ -66,8 +67,13 @@ public static Waiter serviceEndpointsAreReady(OpenShift openShift, String servic
}

public static Waiter routeIsUp(String routeURL) {
return new SimpleWaiter(
() -> Https.getCode(routeURL) != 503)
.reason("Wait until the route is ready to serve.");
return new SimpleWaiter(() ->
{
try {
return Https.getCode(routeURL) != 503;
} catch (HttpsException ex) {
return false;
}
}).reason("Wait until the route is ready to serve.");
}
}

0 comments on commit 4d3c181

Please sign in to comment.