6060
6161 - name : Verify deployment and operator-wired OIDC
6262 run : |
63+ # add-software-pack returns as soon as the Application reports
64+ # Healthy, which a freshly created app does vacuously before its
65+ # first sync creates any resources. Wait for the Deployment to
66+ # exist before asserting anything about it (rollout status with a
67+ # selector exits 0 on zero matches, so it is not a wait).
68+ for i in $(seq 1 60); do
69+ kubectl get deploy -n nebi -l app.kubernetes.io/name=nebari-nebi-pack \
70+ -o name 2>/dev/null | grep -q . && break
71+ echo "Waiting for nebi deployment to be created... (${i}/60)"
72+ sleep 5
73+ done
6374 kubectl rollout status deployment -n nebi \
6475 -l app.kubernetes.io/name=nebari-nebi-pack --timeout=180s
6576
@@ -71,18 +82,26 @@ jobs:
7182 || { echo "OIDC env not wired"; exit 1; }
7283
7384 - name : Verify the gateway redirects nebi to Keycloak
74- env :
75- GATEWAY_IP : ${{ steps.sandbox.outputs.gateway-ip }}
85+ # Reach the gateway through a port-forward to Envoy's LoadBalancer
86+ # Service rather than the LB IP, which is not routable from the
87+ # runner's network namespace.
7688 run : |
89+ svc=$(kubectl get svc -n envoy-gateway-system \
90+ -o jsonpath='{.items[?(@.spec.type=="LoadBalancer")].metadata.name}')
91+ kubectl port-forward -n envoy-gateway-system "svc/${svc}" 8443:443 &
92+ pf=$!
93+ trap 'kill $pf' EXIT
94+ for i in $(seq 1 30); do
95+ curl -sk -o /dev/null --connect-timeout 2 https://127.0.0.1:8443/ && break
96+ sleep 1
97+ done
7798 loc=$(curl -sk -o /dev/null -w '%{redirect_url}' \
78- --resolve "nebi.nebari.local:443:${GATEWAY_IP} " \
79- https://nebi.nebari.local/)
99+ --resolve "nebi.nebari.local:8443:127.0.0.1 " \
100+ https://nebi.nebari.local:8443 /)
80101 echo "redirect: $loc"
81102 echo "$loc" | grep -q 'keycloak.nebari.local/realms/nebari/protocol/openid-connect/auth' \
82103 || { echo "nebi did not redirect to Keycloak"; exit 1; }
83104
84105 - name : Cleanup
85106 if : always()
86- run : |
87- k3d cluster delete ${{ steps.sandbox.outputs.cluster-name }} || true
88- docker network rm ${{ steps.sandbox.outputs.network-name }} 2>/dev/null || true
107+ run : kind delete cluster --name ${{ steps.sandbox.outputs.cluster-name }} || true
0 commit comments