Ensure scripts and dev-env works in osx (#5062)
This commit is contained in:
parent
28350f9876
commit
4a33b1e163
2 changed files with 4 additions and 3 deletions
2
Makefile
2
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
|
||||
|
|
|
@ -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 <<EOF
|
||||
|
||||
|
|
Loading…
Reference in a new issue