From 885cdb2ac15121b9e9dc604077494e0ecb0e53dc Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Thu, 21 Nov 2019 10:23:19 +0100 Subject: [PATCH 1/2] Fix shellcheck lints in dev-env.sh --- build/dev-env.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/dev-env.sh b/build/dev-env.sh index c45cd78cd..f0a42172c 100755 --- a/build/dev-env.sh +++ b/build/dev-env.sh @@ -37,11 +37,12 @@ test $(minikube status | grep -c Running) -ge 2 && $(minikube status | grep -q ' --extra-config=kubelet.sync-frequency=1s \ --extra-config=apiserver.authorization-mode=RBAC +# shellcheck disable=SC2046 eval $(minikube docker-env --shell bash) echo "[dev-env] building container" make build container -docker tag "${REGISTRY}/nginx-ingress-controller-${ARCH}:${TAG}" ${DEV_IMAGE} +docker tag "${REGISTRY}/nginx-ingress-controller-${ARCH}:${TAG}" "${DEV_IMAGE}" # kubectl >= 1.14 includes Kustomize via "apply -k". Makes it easier to use on Linux as well, assuming kubectl installed KUBE_CLIENT_VERSION=$(kubectl version --client --short | awk '{print $3}' | cut -d. -f2) || true @@ -56,7 +57,7 @@ if ! kubectl get namespace "${NAMESPACE}"; then kubectl create namespace "${NAMESPACE}" fi -kubectl get deploy nginx-ingress-controller -n ${NAMESPACE} && kubectl delete deploy nginx-ingress-controller -n ${NAMESPACE} +kubectl get deploy nginx-ingress-controller -n "${NAMESPACE}" && kubectl delete deploy nginx-ingress-controller -n "${NAMESPACE}" ROOT=./deploy/minikube From bb25070f64c05b453bc355414cb889e0780771aa Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Thu, 21 Nov 2019 10:25:31 +0100 Subject: [PATCH 2/2] Fix for parsing `minikube status` output of newer versions Changed in https://github.com/kubernetes/minikube/commit/ca7d378aaaef66ef69c4f88303e2ec29e10f47b3 to "Configured" or "Misconfigured" --- build/dev-env.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dev-env.sh b/build/dev-env.sh index f0a42172c..e535af5c4 100755 --- a/build/dev-env.sh +++ b/build/dev-env.sh @@ -33,7 +33,8 @@ export REGISTRY=${REGISTRY:-ingress-controller} DEV_IMAGE=${REGISTRY}/nginx-ingress-controller:${TAG} -test $(minikube status | grep -c Running) -ge 2 && $(minikube status | grep -q 'Correctly Configured') || minikube start \ +{ [ "$(minikube status | grep -c Running)" -ge 2 ] && minikube status | grep -qE ': Configured$|Correctly Configured'; } \ + || minikube start \ --extra-config=kubelet.sync-frequency=1s \ --extra-config=apiserver.authorization-mode=RBAC