-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
461 additions
and
16,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,41 +5,31 @@ PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH))) | |
GO ?= go | ||
KUADRANT_NAMESPACE=kuadrant-system | ||
|
||
include utils.mk | ||
|
||
all: help | ||
|
||
.PHONY : help | ||
help: Makefile | ||
@sed -n 's/^##//p' $< | ||
|
||
# Kind tool | ||
# Ginkgo tool | ||
GINKGO = $(PROJECT_PATH)/bin/ginkgo | ||
$(GINKGO): | ||
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/[email protected]) | ||
|
||
KIND = $(PROJECT_PATH)/bin/kind | ||
KIND_CLUSTER_NAME = kuadrant-local | ||
KIND_VERSION = v0.20.0 | ||
$(KIND): | ||
$(call go-install-tool,$(KIND),sigs.k8s.io/kind@$(KIND_VERSION)) | ||
|
||
.PHONY: kind | ||
kind: $(KIND) ## Download kind locally if necessary. | ||
|
||
# istioctl tool | ||
ISTIOCTL=$(PROJECT_PATH)/bin/istioctl | ||
ISTIOVERSION = 1.17.2 | ||
$(ISTIOCTL): | ||
mkdir -p $(PROJECT_PATH)/bin | ||
$(eval TMP := $(shell mktemp -d)) | ||
cd $(TMP); curl -sSL https://istio.io/downloadIstio | ISTIO_VERSION=$(ISTIOVERSION) sh - | ||
cp $(TMP)/istio-$(ISTIOVERSION)/bin/istioctl ${ISTIOCTL} | ||
-rm -rf $(TMP) | ||
KUSTOMIZE = $(PROJECT_PATH)/bin/kustomize | ||
$(KUSTOMIZE): | ||
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
|
||
.PHONY: istioctl | ||
istioctl: $(ISTIOCTL) | ||
|
||
# Ginkgo tool | ||
GINKGO = $(PROJECT_PATH)/bin/ginkgo | ||
$(GINKGO): | ||
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/[email protected]) | ||
.PHONY: kustomize | ||
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. | ||
|
||
## test: Run unit tests | ||
.PHONY : test | ||
|
@@ -53,6 +43,28 @@ test: fmt vet $(GINKGO) | |
install: fmt vet | ||
GOBIN=$(PROJECT_PATH)/bin $(GO) install | ||
|
||
.PHONY: prepare-local-cluster | ||
prepare-local-cluster: $(KIND) ## Deploy locally kuadrant operator from the current code | ||
$(MAKE) kind-delete-cluster | ||
$(MAKE) kind-create-cluster | ||
|
||
.PHONY: env-setup | ||
env-setup: | ||
$(MAKE) olm-install | ||
$(MAKE) gateway-api-install | ||
$(MAKE) istio-install | ||
|
||
## local-setup: Sets up Kind cluster with GatewayAPI manifests and istio GW, nothing Kuadrant. Build and install kuadrantctl binary | ||
.PHONY: local-setup | ||
local-setup: | ||
$(MAKE) prepare-local-cluster | ||
$(MAKE) env-setup | ||
|
||
## local-cleanup: Delete local cluster | ||
.PHONY: local-cleanup | ||
local-cleanup: ## Delete local cluster | ||
$(MAKE) kind-delete-cluster | ||
|
||
.PHONY : fmt | ||
fmt: | ||
$(GO) fmt ./... | ||
|
@@ -61,80 +73,5 @@ fmt: | |
vet: | ||
$(GO) vet ./... | ||
|
||
# Generates istio manifests with patches. | ||
.PHONY: generate-istio-manifests | ||
generate-istio-manifests: istioctl | ||
$(ISTIOCTL) manifest generate --set profile=minimal --set values.gateways.istio-ingressgateway.autoscaleEnabled=false --set values.pilot.autoscaleEnabled=false --set values.global.istioNamespace=kuadrant-system -f istiomanifests/patches/istio-externalProvider.yaml -o istiomanifests/autogenerated | ||
|
||
.PHONY: istio-manifest-update-test | ||
istio-manifest-update-test: generate-istio-manifests | ||
git diff --exit-code ./istiomanifests/autogenerated | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./istiomanifests/autogenerated)" ] | ||
|
||
# Generates kuadrant manifests. | ||
KUADRANTVERSION=main | ||
KUADRANT_CONTROLLER_IMAGE=quay.io/kuadrant/kuadrant-controller:$(KUADRANTVERSION) | ||
.PHONY: generate-kuadrant-manifests | ||
generate-kuadrant-manifests: | ||
$(eval TMP := $(shell mktemp -d)) | ||
cd $(TMP); git clone --depth 1 --branch $(KUADRANTVERSION) https://github.com/kuadrant/kuadrant-controller.git | ||
cd $(TMP)/kuadrant-controller; make kustomize | ||
cd $(TMP)/kuadrant-controller/config/manager; $(TMP)/kuadrant-controller/bin/kustomize edit set image controller=${KUADRANT_CONTROLLER_IMAGE} | ||
cd $(TMP)/kuadrant-controller/config/default; $(TMP)/kuadrant-controller/bin/kustomize edit set namespace $(KUADRANT_NAMESPACE) | ||
cd $(TMP)/kuadrant-controller; bin/kustomize build config/default -o $(PROJECT_PATH)/kuadrantmanifests/autogenerated/kuadrant.yaml | ||
-rm -rf $(TMP) | ||
|
||
.PHONY: kuadrant-manifest-update-test | ||
kuadrant-manifest-update-test: generate-kuadrant-manifests | ||
git diff --exit-code ./kuadrantmanifests/autogenerated | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./kuadrantmanifests/autogenerated)" ] | ||
|
||
# Generates limitador manifests. | ||
LIMITADOR_OPERATOR_VERSION=main | ||
LIMITADOR_OPERATOR_IMAGE=quay.io/kuadrant/limitador-operator:$(LIMITADOR_OPERATOR_VERSION) | ||
.PHONY: generate-limitador-operator-manifests | ||
generate-limitador-operator-manifests: | ||
$(eval TMP := $(shell mktemp -d)) | ||
cd $(TMP); git clone --depth 1 --branch $(LIMITADOR_OPERATOR_VERSION) https://github.com/kuadrant/limitador-operator.git | ||
cd $(TMP)/limitador-operator; make kustomize | ||
cd $(TMP)/limitador-operator/config/manager; $(TMP)/limitador-operator/bin/kustomize edit set image controller=$(LIMITADOR_OPERATOR_IMAGE) | ||
cd $(TMP)/limitador-operator/config/default; $(TMP)/limitador-operator/bin/kustomize edit set namespace $(KUADRANT_NAMESPACE) | ||
cd $(TMP)/limitador-operator; bin/kustomize build config/default -o $(PROJECT_PATH)/limitadormanifests/autogenerated/limitador-operator.yaml | ||
-rm -rf $(TMP) | ||
|
||
.PHONY: limitador-operator-manifest-update-test | ||
limitador-operator-manifest-update-test: generate-limitador-operator-manifests | ||
git diff --exit-code ./limitadormanifests/autogenerated | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./limitadormanifests/autogenerated)" ] | ||
|
||
# Generates authorino operator manifests. | ||
AUTHORINO_OPERATOR_VERSION=main | ||
.PHONY: generate-authorino-operator-manifests | ||
generate-authorino-operator-manifests: | ||
curl -sSf https://raw.githubusercontent.com/Kuadrant/authorino-operator/$(AUTHORINO_OPERATOR_VERSION)/config/deploy/manifests.yaml > $(PROJECT_PATH)/authorinomanifests/autogenerated/authorino-operator.yaml | ||
|
||
.PHONY: authorino-manifest-update-test | ||
authorino-operator-manifest-update-test: generate-authorino-operator-manifests | ||
git diff --exit-code ./authorinomanifests/autogenerated | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./authorinomanifests/autogenerated)" ] | ||
|
||
.PHONY : cluster-cleanup | ||
cluster-cleanup: $(KIND) | ||
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME) | ||
|
||
.PHONY : cluster-setup | ||
cluster-setup: $(KIND) cluster-cleanup | ||
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config utils/kind/cluster.yaml | ||
|
||
GOLANGCI-LINT=$(PROJECT_PATH)/bin/golangci-lint | ||
$(GOLANGCI-LINT): | ||
mkdir -p $(PROJECT_PATH)/bin | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_PATH)/bin v1.41.1 | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: $(GOLANGCI-LINT) | ||
|
||
.PHONY: run-lint | ||
run-lint: $(GOLANGCI-LINT) | ||
$(GOLANGCI-LINT) run --timeout 2m | ||
|
||
# Include last to avoid changing MAKEFILE_LIST used above | ||
include ./make/*.mk |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.