-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from jaypipes/kind-custom
allow KinD clusters to be deleted or retained
- Loading branch information
Showing
9 changed files
with
231 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,44 @@ | ||
VERSION ?= $(shell git describe --tags --always --dirty) | ||
CLUSTERS = $(shell kind get clusters) | ||
|
||
.PHONY: test | ||
|
||
kind-install: | ||
ifeq (, $(shell command -v kind)) | ||
go install sigs.k8s.io/kind@v0.23.0 | ||
endif | ||
|
||
# We clear the test cache because some of the tests require an out-of-band KinD | ||
# cluster to run against and we want to re-run tests against that KinD cluster | ||
# instead of from cached unit test results. | ||
test: | ||
clear-test-cache: | ||
@echo -n "clearing Go test cache ... " | ||
@go clean -testcache | ||
@go test -v ./... | ||
@echo "ok." | ||
|
||
kind-clear-clusters: | ||
ifneq (, $(shell command -v kind)) | ||
ifneq (, $(CLUSTERS)) | ||
@echo -n "clearing KinD clusters ... " | ||
@for c in $(CLUSTERS); do kind delete cluster -q --name $$c; done | ||
@echo "ok." | ||
endif | ||
endif | ||
|
||
kind-create-cluster: | ||
ifneq (, $(shell command -v kind)) | ||
@echo -n "creating 'kind' cluster ... " | ||
@kind create cluster -q | ||
@echo "ok." | ||
@sleep 5 | ||
endif | ||
|
||
test: clear-test-cache kind-clear-clusters kind-create-cluster test-kind-simple | ||
|
||
test-kind-simple: | ||
@go test -v ./parse_test.go | ||
@go test -v ./eval_test.go | ||
|
||
test-all: test kind-clear-clusters | ||
@go test -v ./fixtures/kind/kind_test.go | ||
@go test -v ./placement_test.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.