Skip to content

Commit

Permalink
CI: add wait for autohttps acquired certs to be saved during upgrade …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
consideRatio committed Nov 10, 2020
1 parent df4d7db commit 685d521
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
helm install jupyterhub jupyterhub/jupyterhub --values dev-config.yaml
await_jupyterhub
await_autohttps_tls_cert_acquisition
await_autohttps_tls_cert_save
- name: Install JupyterHub dev chart
run: |
Expand Down
25 changes: 20 additions & 5 deletions ci/common
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ await_jupyterhub() {

await_autohttps_tls_cert_acquisition() {
i=0; while [ $i -ne 60 ]; do
kubectl logs deploy/pebble -c pebble | grep "Issued certificate" \
kubectl logs deploy/autohttps -c traefik | grep "Adding certificate" \
&& acquired_cert=true && break \
|| acquired_cert=false && sleep 0.5 && i=$((i + 1))
done
Expand All @@ -62,6 +62,25 @@ await_autohttps_tls_cert_acquisition() {
sleep 1
}

await_autohttps_tls_cert_save() {
i=0; while [ $i -ne 60 ]; do
kubectl logs deploy/autohttps -c secret-sync | grep "Created secret" \
&& saved_cert=true && break \
|| saved_cert=false && sleep 0.5 && i=$((i + 1))
done
if [ "$saved_cert" != "true" ]; then
echo "Certificate acquisition failed!"
kubectl get service,networkpolicy,configmap,pod
kubectl describe pod -l app.kubernetes.io/name=pebble
kubectl logs deploy/pebble --all-containers # --prefix
kubectl describe pod -l app.kubernetes.io/name=pebble-coredns
kubectl logs deploy/pebble-coredns --all-containers # --prefix
kubectl describe pod -l component=autohttps
kubectl logs deploy/autohttps --all-containers # --prefix
exit 1
fi
}

setup_kubeval () {
echo "setup kubeval ${KUBEVAL_VERSION}"
curl -sfL https://github.com/instrumenta/kubeval/releases/download/${KUBEVAL_VERSION}/kubeval-linux-amd64.tar.gz | tar xz kubeval
Expand Down Expand Up @@ -106,10 +125,6 @@ full_namespace_report () {
echo ""
echo "Just while debugging intermittent issue, lets output the logs of the proxy pod."
kubectl logs --all-containers deploy/proxy

echo ""
echo "Just while debugging intermittent issue, lets output the logs of the autohttps pod."
kubectl logs --all-containers deploy/autohttps
}

install_and_run_chartpress_and_pebble () {
Expand Down

0 comments on commit 685d521

Please sign in to comment.