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"