Skip to content

Commit

Permalink
kubectl-wait-ready: more robust implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Jan 22, 2024
1 parent c43d9ac commit 913daab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ rec {
namespace=$1
name=$2
echo "Waiting for $name.$namespace to become ready" >&2
timeout=180
interval=4
while [ $timeout -gt 0 ]; do
if kubectl -n "$namespace" get pods | grep -q "$name"; then
if kubectl -n "$namespace" get pods -o custom-columns=LABELS:.metadata.labels | grep -q "app.kubernetes.io/name:$name"; then
break
fi
sleep "$interval"
Expand Down

0 comments on commit 913daab

Please sign in to comment.