tests/k8s: increase wait time of KBS service ingress

kbs_k8s_svc_host() returns the ingress IP when the KBS service is
exposed via an ingress. In Azure AKS the ingress can time a while to be
fully ready and recently we have noticed on CI that kbs_k8s_svc_host()
has returned empty value. Maybe the problem is on current timeout being
too low, so let's increase it to 50 seconds to see if the situation
improves.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta 2025-05-20 15:20:08 -03:00
parent f8c5aa6df6
commit fdcf11d090

View File

@ -429,11 +429,12 @@ function kbs_k8s_deploy() {
kbs_k8s_svc_host() { kbs_k8s_svc_host() {
if kubectl get ingress -n "$KBS_NS" 2>/dev/null | grep -q kbs; then if kubectl get ingress -n "$KBS_NS" 2>/dev/null | grep -q kbs; then
local host local host
local timeout=50
# The ingress IP address can take a while to show up. # The ingress IP address can take a while to show up.
SECONDS=0 SECONDS=0
while true; do while true; do
host=$(kubectl get ingress "${KBS_INGRESS_NAME}" -n "${KBS_NS}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}') host=$(kubectl get ingress "${KBS_INGRESS_NAME}" -n "${KBS_NS}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
[[ -z "${host}" && ${SECONDS} -lt 30 ]] || break [[ -z "${host}" && ${SECONDS} -lt "${timeout}" ]] || break
sleep 5 sleep 5
done done
echo "${host}" echo "${host}"