#!/bin/bash
custom_package_wait() {
  timeElapsed=0
  sleepTime=3
  timeout=600
  while [[ $timeElapsed -le $timeout ]]; do
    podCount=$(kubectl get pods -n kubevirt | grep "1/1" -c)
    #Note: podCount = 7  assumes .Values.deployment.spec.replicas = 2
    if [[ "$podCount" -eq "7" ]]; then
      break
    fi
    sleep $sleepTime
    timeElapsed=$(($timeElapsed + $sleepTime))
  done
}
