From 4a33b1e163c288d7c9036e681e6f63a1b19d1051 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Wed, 12 Feb 2020 21:48:41 -0300 Subject: [PATCH] Ensure scripts and dev-env works in osx (#5062) --- Makefile | 2 +- build/dev-env.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4e503dc36..7c65b4251 100644 --- a/Makefile +++ b/Makefile @@ -232,7 +232,7 @@ dep-ensure: check-go-version ## Update and vendo go dependencies. .PHONY: dev-env dev-env: check-go-version ## Starts a local Kubernetes cluster using minikube, building and deploying the ingress controller. - @DIND_TASKS=0 USE_DOCKER=false build/dev-env.sh + @build/dev-env.sh .PHONY: live-docs live-docs: ## Build and launch a local copy of the documentation website in http://localhost:3000 diff --git a/build/dev-env.sh b/build/dev-env.sh index a1f9dc1a0..c4ee3fbe2 100755 --- a/build/dev-env.sh +++ b/build/dev-env.sh @@ -91,10 +91,11 @@ kubectl create namespace ingress-nginx || true kubectl apply -k ${DIR}/../deploy/kind echo "[dev-env] deleting old ingress-nginx pods..." +MINUTE_AGO=$(python -c "from datetime import datetime,timedelta; print((datetime.utcnow()-timedelta(seconds=60)).strftime('%Y-%m-%dT%H:%M:%SZ'))") kubectl get pods --namespace ingress-nginx -o go-template \ --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | \ - awk '$2 <= $(python -c "from datetime import datetime,timedelta; print((datetime.now()-timedelta(seconds=60)).strftime(\"%Y-%m-%dT%H:%M:%S%Z\"))") { print $1 }' | \ - xargs --no-run-if-empty kubectl delete pod --namespace ingress-nginx + awk -v MINUTE_AGO=$MINUTE_AGO '$2 <= MINUTE_AGO { print $1 }' | \ + xargs kubectl delete pod --namespace ingress-nginx cat <