Skip to content

Commit

Permalink
Use temporary file for kind-load target
Browse files Browse the repository at this point in the history
This simplified logic should work on both podman and docker, removing
our need to have distinct ways of handling the image loading.
  • Loading branch information
trgeiger committed Apr 30, 2024
1 parent 32ed986 commit 5ee07f7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,10 @@ e2e-coverage:

.PHONY: kind-load
kind-load: $(KIND) #EXHELP Loads the currently constructed image onto the cluster.
ifeq ($(CONTAINER_RUNTIME),podman)
@echo "Using Podman"
podman save $(IMG) -o $(IMG).tar
$(KIND) load image-archive $(IMG).tar --name $(KIND_CLUSTER_NAME)
rm $(IMG).tar
else
@echo "Using Docker"
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)
endif
TMP_FILE=$(shell mktemp -t operator-controller-image-archive-XXXX.tar) ;\
$(CONTAINER_RUNTIME) save $(IMG) -o $$TMP_FILE ;\
$(KIND) load image-archive $$TMP_FILE --name $(KIND_CLUSTER_NAME) ;\
rm $$TMP_FILE

kind-deploy: export MANIFEST="./operator-controller.yaml"
kind-deploy: manifests $(KUSTOMIZE) #EXHELP Install controller and dependencies onto the kind cluster.
Expand Down

0 comments on commit 5ee07f7

Please sign in to comment.