Skip to content

Commit

Permalink
Merge pull request #4766 from AndiDog/dev-env-fixes
Browse files Browse the repository at this point in the history
dev-env.sh: fix for parsing `minikube status` output of newer versions, fix shellcheck lints
  • Loading branch information
k8s-ci-robot authored Nov 25, 2019
2 parents 59a9753 + bb25070 commit 9f72cb3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build/dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ 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

# 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
Expand All @@ -56,7 +58,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

Expand Down

0 comments on commit 9f72cb3

Please sign in to comment.