Adding docker-kind-load target for kind-voltha development
Change-Id: I43c9a2b65d14c22ef692ab6c8eedf3d53b744b8d
diff --git a/Makefile b/Makefile
index 37bb9b6..32f1708 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,7 @@
DOCKER_REPOSITORY ?=
DOCKER_TAG ?= ${VERSION}$(shell [[ ${DOCKER_LABEL_VCS_DIRTY} == "true" ]] && echo "-dirty" || true)
PONSIMONU_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-adapter-ponsim-onu
+TYPE ?= minimal
## Docker labels. Only set ref and commit date if committed
DOCKER_LABEL_VCS_URL ?= $(shell git remote get-url $(shell git remote))
@@ -116,6 +117,10 @@
docker-push:
docker push ${PONSIMONU_IMAGENAME}:${DOCKER_TAG}
+docker-kind-load:
+ @if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi
+ kind load docker-image ${PONSIMONU_IMAGENAME}:${DOCKER_TAG} --name=voltha-$(TYPE) --nodes $(shell kubectl get nodes --template='{{range .items}}{{.metadata.name}},{{end}}' | sed 's/,$$//')
+
## lint and unit tests
PATH:=$(GOPATH)/bin:$(PATH)