Skip to content

Commit

Permalink
Update makefile to support standalone Podman (Kuadrant#687)
Browse files Browse the repository at this point in the history
* Support the use of sole podman installation without the need for docker.

* updates from PR comments
  • Loading branch information
Boomatang authored and dlaw4608 committed Jun 17, 2024
1 parent b4d3935 commit ccb62ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SHELL = /usr/bin/env bash -o pipefail
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))

# Container Engine to be used for building image and with kind
CONTAINER_ENGINE ?= docker

# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
Expand Down Expand Up @@ -314,16 +317,19 @@ run: generate fmt vet ## Run a controller from your host.
go run ./main.go

docker-build: ## Build docker image with the manager.
docker build -t $(IMG) .
$(CONTAINER_ENGINE) build -t $(IMG) .

docker-push: ## Push docker image with the manager.
docker push $(IMG)
$(CONTAINER_ENGINE) push $(IMG)

kind-load-image: ## Load image to local cluster
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)
$(eval TMP_DIR := $(shell mktemp -d))
$(CONTAINER_ENGINE) save -o $(TMP_DIR)/image.tar $(IMG) \
&& KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) $(KIND) load image-archive $(TMP_DIR)/image.tar $(IMG) --name $(KIND_CLUSTER_NAME) ; \
EXITVAL=$$? ; \
rm -rf $(TMP_DIR) ;\
exit $${EXITVAL}

kind-load-bundle: ## Load image to local cluster
$(KIND) load docker-image $(BUNDLE_IMG) --name $(KIND_CLUSTER_NAME)

# go-install-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down Expand Up @@ -374,7 +380,7 @@ bundle-ignore-createdAt:

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
$(CONTAINER_ENGINE) build -f bundle.Dockerfile -t $(BUNDLE_IMG) .

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
Expand Down
3 changes: 2 additions & 1 deletion make/development-environments.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ namespace: ## Creates a namespace where to deploy Kuadrant Operator
.PHONY: local-deploy
local-deploy: ## Deploy Kuadrant Operator from the current code
$(MAKE) docker-build IMG=$(IMAGE_TAG_BASE):dev
$(KIND) load docker-image $(IMAGE_TAG_BASE):dev --name $(KIND_CLUSTER_NAME)
$(MAKE) kind-load-image IMG=$(IMAGE_TAG_BASE):dev

$(MAKE) deploy IMG=$(IMAGE_TAG_BASE):dev
kubectl -n $(KUADRANT_NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all

Expand Down
4 changes: 2 additions & 2 deletions make/kind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ KIND_CLUSTER_NAME ?= kuadrant-local

.PHONY: kind-create-cluster
kind-create-cluster: kind ## Create the "kuadrant-local" kind cluster.
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config utils/kind-cluster.yaml
KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config utils/kind-cluster.yaml

.PHONY: kind-delete-cluster
kind-delete-cluster: kind ## Delete the "kuadrant-local" kind cluster.
- $(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
- KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) $(KIND) delete cluster --name $(KIND_CLUSTER_NAME)

0 comments on commit ccb62ca

Please sign in to comment.