feat: wait for k8s pods

This commit is contained in:
Janik von Rotz committed 2024-12-15 20:49:48 +01:00
1 parent e10e388543
commit 4221a7aed2
1 file changed
+5
+5
View File
@@ -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"