Skip to content

Commit 14d7874

Browse files
shmuelkvMaroon
authored andcommitted
Simplified wait for creation of K8S system pods
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent 05d623a commit 14d7874

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

scripts/kind-dev-env.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,12 @@ ${CONTAINER_RUNTIME} exec -it ${CONTAINER_NAME} /bin/bash -c "sysctl net.ipv4.co
114114

115115
# Wait for all pods to be ready
116116
kubectl --context ${KUBE_CONTEXT} -n kube-system wait --for=condition=Ready --all pods --timeout=300s
117-
once=1
118-
while !(kubectl --context ${KUBE_CONTEXT} -n local-path-storage wait --for=condition=Ready --all pods --timeout=300s); do
119-
if [[ $once -eq 1 ]]; then
120-
sleep 10
121-
once=0
122-
else
123-
echo "Base cluster pods are not all active"
124-
exit 1
125-
fi
126-
done
117+
118+
if kubectl --context ${KUBE_CONTEXT} -n local-path-storage get pods > /dev/null 2>&1; [ $? -ne 0 ]; then
119+
# Wait a bit for the local-path-storage pods to be created
120+
sleep 10
121+
fi
122+
kubectl --context ${KUBE_CONTEXT} -n local-path-storage wait --for=condition=Ready --all pods --timeout=300s
127123

128124
# ------------------------------------------------------------------------------
129125
# Load Container Images

0 commit comments

Comments
 (0)