#!/usr/bin/env bash

scripts_dir=$(dirname $0)
. ${scripts_dir}/../helper_scripts/cosmic/helperlib.sh

set -e

say "Running script: $0"

until minikube_start "true"
do
  say "minikube failed to start, retrying."
done

minikube_get_ip

say "Waiting for kubernetes to be available."
while ! nc -w 2 -v ${minikube_ip} 8443 2>&1 > /dev/null; do
  sleep 1 # wait for 1/10 of the second before check again
done

#!/usr/bin/env bash

scripts_dir=$(dirname $0)
. ${scripts_dir}/../helper_scripts/cosmic/helperlib.sh

set -e

say "Running script: $0"

until minikube_start "true"
do
  say "minikube failed to start, retrying."
done

minikube_get_ip

say "Waiting for kubernetes to be available."
until (echo > /dev/tcp/${minikube_ip}/8443) &> /dev/null; do
    sleep 1 
done

Replace ncat as it keeps an open connection untill timeout
Replace ncat as it keeps an open connection untill timeout

This/newer versions are missing the `-z` flag to just test a port
