Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update makefile to support standalone Podman #687

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
eguzki marked this conversation as resolved.
Show resolved Hide resolved

# 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)
Loading