Skip to content

Commit

Permalink
Fix pod running checks
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <grant@portworx.com>
  • Loading branch information
ggriffiths committed Dec 3, 2019
1 parent d16108c commit 6f63fc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions deploy/util/deploy-hostpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ done
# snapshotter, resizer, socat and hostpath plugin in the default namespace.
expected_running_pods=6
cnt=0
while [ $(kubectl get pods -l app=csi-hostpath 2>/dev/null | grep 'Running' | wc -l) -lt $expected_running_pods ] || ! kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io 2>/dev/null >/dev/null; do
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt $expected_running_pods ] || ! kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io 2>/dev/null >/dev/null; do
if [ $cnt -gt 30 ]; then
echo "$(kubectl get pods -l app=csi-hostpath 2>/dev/null | grep 'Running' | wc -l) running pods:"
echo "$(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) running pods:"
kubectl describe pods
(set -x; kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io) || true
Expand All @@ -219,4 +219,5 @@ done
# deploy snapshotclass
echo "deploying snapshotclass"
SNAPSHOTCLASS_PATH="${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml"
kubectl apply -f $SNAPSHOTCLASS_PATH
2 changes: 1 addition & 1 deletion release-tools/prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ install_snapshot_controller() {
kubectl apply -f "https://github.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml"
cnt=0
expected_running_pods=3
while [ $(kubectl get pods -l app=snapshot-controller | grep 'Running' | wc -l) -lt $expected_running_pods ]; do
while [ "$(kubectl get pods -l app=snapshot-controller | grep 'Running' -c)" -lt $expected_running_pods ]; do
if [ $cnt -gt 30 ]; then
echo "snapshot-controller pod status:"
kubectl describe pods -l app=snapshot-controller
Expand Down

0 comments on commit 6f63fc5

Please sign in to comment.