From 4221a7aed27e9b90ea307be1045fc7eb780d68fc Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Sun, 15 Dec 2024 20:49:48 +0100 Subject: [PATCH] feat: wait for k8s pods --- task | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/task b/task index 20396892..d645fca9 100755 --- a/task +++ b/task @@ -851,6 +851,11 @@ function k8s-apply() { kubectl apply -f k8s/odoo-svc.yaml ODOO_POD=$(kubectl get pods -o=name --all-namespaces | grep odoo | sed 's/pod\///') + POSTGRES_POD=$(kubectl get pods -o=name --all-namespaces | grep postgres | sed 's/pod\///') + + kubectl wait --for=condition=Ready "$ODOO_POD" + kubectl wait --for=condition=Ready "$POSTGRES_POD" + echo "Init Odoo database in $ODOO_POD pod:" kubectl exec "$ODOO_POD" -- env kubectl exec "$ODOO_POD" -- /bin/bash -c "odoo -d odoo -i web --db_host \$HOST -r\$USER -w\$PASSWORD --stop-after-init --no-http"