Adding docker-kind-load target
Change-Id: I86148d0423d35a3a24683df1d317260e18544867
diff --git a/Makefile b/Makefile
index 1016c2d..c31e0e5 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@
DOCKER_TAG ?= ${VERSION}$(shell [[ ${DOCKER_LABEL_VCS_DIRTY} == "true" ]] && echo "-dirty" || true)
RWCORE_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-rw-core
ROCORE_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-ro-core
+TYPE ?= minimal
## Docker labels. Only set ref and commit date if committed
DOCKER_LABEL_VCS_URL ?= $(shell git remote get-url $(shell git remote))
@@ -110,6 +111,11 @@
docker push ${RWCORE_IMAGENAME}:${DOCKER_TAG}
docker push ${ROCORE_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 ${RWCORE_IMAGENAME}:${DOCKER_TAG} --name=voltha-$(TYPE) --nodes $(shell kubectl get nodes --template='{{range .items}}{{.metadata.name}},{{end}}' | rev | cut -c 2- | rev)
+ kind load docker-image ${ROCORE_IMAGENAME}:${DOCKER_TAG} --name=voltha-$(TYPE) --nodes $(shell kubectl get nodes --template='{{range .items}}{{.metadata.name}},{{end}}' | rev | cut -c 2- | rev)
+
## lint and unit tests
PATH:=$(GOPATH)/bin:$(PATH)