Improve SSO_URL waiting logic
@@ -39,7 +39,10 @@ function ingress_url() {
case $CLUSTER in
openshift)
- URL="https://$(kubectl get route -n "$DROGUE_NS" "$name" -o 'jsonpath={ .spec.host }')"
+ URL="$(kubectl get route -n "$DROGUE_NS" "$name" -o 'jsonpath={ .spec.host }')"
+ if ! [ -z $URL ]; then
+ URL="https://$URL"
+ fi
;;
kind)
# Workaround to use the node-port service
@@ -48,10 +51,15 @@ case $CLUSTER in
fi
DOMAIN=$(kubectl get node kind-control-plane -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}').nip.io
PORT=$(kubectl get service -n "$DROGUE_NS" "$name" -o jsonpath='{.spec.ports[0].nodePort}')
- URL=http://$name.$DOMAIN:$PORT
+ if ! [ -z $DOMAIN ]; then
+ URL="http://$name.$DOMAIN:$PORT"
+ fi
;;
*)
- URL="http://$(kubectl get ingress -n "$DROGUE_NS" "$name" -o 'jsonpath={ .status.loadBalancer.ingress[0].ip }')"
+ URL=$(kubectl get ingress -n "$DROGUE_NS" "$name" -o 'jsonpath={ .status.loadBalancer.ingress[0].ip }')
+ if ! [ -z $URL ]; then
+ URL="http://$URL"
+ fi
;;
esac;
echo "$URL"
