From: Jeff Layton Date: Fri, 22 Feb 2019 19:40:51 +0000 (-0500) Subject: mgr/dashboard: special casing for minikube in run-backend-rook-api-request.sh X-Git-Tag: v14.1.1~149^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73ab735a509a63b24b38833da9cf6af4617e36af;p=ceph.git mgr/dashboard: special casing for minikube in run-backend-rook-api-request.sh For people running minikube for testing, the hostname "minikube" is often not resolvable. If that's what the hostname is, then get the address from "minikube ip" instead. Signed-off-by: Jeff Layton --- diff --git a/src/pybind/mgr/dashboard/run-backend-rook-api-request.sh b/src/pybind/mgr/dashboard/run-backend-rook-api-request.sh index 1390994c90fd..ef221dcfb039 100755 --- a/src/pybind/mgr/dashboard/run-backend-rook-api-request.sh +++ b/src/pybind/mgr/dashboard/run-backend-rook-api-request.sh @@ -8,6 +8,9 @@ CURR_DIR=`pwd` K8S_NAMESPACE='rook-ceph' HOST=$(kubectl get pods -n $K8S_NAMESPACE -l "app=rook-ceph-mgr" -o json | jq .items[0].spec.nodeName | sed s/\"//g) +if [ "$HOST" = "minikube" ]; then + HOST=$(minikube ip) +fi PORT=$(kubectl get service -n $K8S_NAMESPACE rook-ceph-mgr-dashboard -o yaml | grep nodePort: | awk '{print $2}') API_URL="https://${HOST}:${PORT}"