@@ -9,23 +9,28 @@ export ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
99
1010GOLANG_VERSION  := $(shell  sed -En 's/^go (.* ) $$/\1/p' "go.mod")
1111#  Image URL to use all building/pushing image targets
12- ifeq  ($(origin IMAGE_REPO ) , undefined)
13- IMAGE_REPO  := quay.io/operator-framework/operator-controller 
12+ ifeq  ($(origin IMAGE_REGISTRY ) , undefined)
13+ IMAGE_REGISTRY  := quay.io/operator-framework
1414endif 
15- export  IMAGE_REPO 
15+ export  IMAGE_REGISTRY 
1616
17- ifeq  ($(origin CATALOG_IMAGE_REPO ) , undefined)
18- CATALOG_IMAGE_REPO  := quay.io /operator-framework/catalogd 
17+ ifeq  ($(origin OPCON_IMAGE_REPO ) , undefined)
18+ OPCON_IMAGE_REPO  := $( IMAGE_REGISTRY ) controller 
1919endif 
20- export  CATALOG_IMAGE_REPO 
20+ export  OPCON_IMAGE_REPO 
21+ 
22+ ifeq  ($(origin CATD_IMAGE_REPO ) , undefined)
23+ CATD_IMAGE_REPO  := $(IMAGE_REGISTRY ) /catalogd
24+ endif 
25+ export  CATD_IMAGE_REPO 
2126
2227ifeq  ($(origin IMAGE_TAG ) , undefined)
2328IMAGE_TAG  := devel
2429endif 
2530export  IMAGE_TAG 
2631
27- IMG  := $(IMAGE_REPO ) :$(IMAGE_TAG ) 
28- CATALOGD_IMG  := $(CATALOG_IMAGE_REPO ) :$(IMAGE_TAG ) 
32+ OPCON_IMG  := $(OPCON_IMAGE_REPO ) :$(IMAGE_TAG ) 
33+ CATD_IMG  := $(CATD_IMAGE_REPO ) :$(IMAGE_TAG ) 
2934
3035#  Define dependency versions (use go.mod if we also use Go code from dependency)
3136export  CERT_MGR_VERSION  := v1.15.3
@@ -87,7 +92,7 @@ KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
8792
8893.PHONY : help
8994help : # HELP Display essential help.
90- 	@awk ' BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_0-9-]+:.*#HELP / { printf "  \033[36m%-15s \033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST ) 
95+ 	@awk ' BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_0-9-]+:.*#HELP / { printf "  \033[36m%-17s \033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST ) 
9196
9297.PHONY : help-extended
9398help-extended : # HELP Display extended help.
@@ -100,11 +105,11 @@ lint: lint-custom $(GOLANGCI_LINT) #HELP Run golangci linter.
100105	$(GOLANGCI_LINT )  run --build-tags $(GO_BUILD_TAGS )  $(GOLANGCI_LINT_ARGS ) 
101106
102107.PHONY : custom-linter-build
103- custom-linter-build : # HELP  Build custom linter
108+ custom-linter-build : # EXHELP  Build custom linter
104109	go build -tags $(GO_BUILD_TAGS )  -o ./bin/custom-linter ./hack/ci/custom-linters/cmd
105110
106111.PHONY : lint-custom
107- lint-custom : custom-linter-build # HELP  Call custom linter for the project
112+ lint-custom : custom-linter-build # EXHELP  Call custom linter for the project
108113	go vet -tags=$(GO_BUILD_TAGS )  -vettool=./bin/custom-linter ./...
109114
110115.PHONY : tidy
@@ -166,6 +171,8 @@ verify-crd-compatibility: $(CRD_DIFF) manifests
166171	$(CRD_DIFF )  --config=" ${CRD_DIFF_CONFIG} " " ${CRD_DIFF_ORIGINAL_REF}${CRD_DIFF_OPCON_SOURCE} " ${CRD_DIFF_UPDATED_REF}${CRD_DIFF_OPCON_SOURCE} 
167172	$(CRD_DIFF )  --config=" ${CRD_DIFF_CONFIG} " " ${CRD_DIFF_ORIGINAL_REF}${CRD_DIFF_CATD_SOURCE} " ${CRD_DIFF_UPDATED_REF}${CRD_DIFF_CATD_SOURCE} 
168173
174+ # SECTION Test
175+ 
169176.PHONY : test
170177test : manifests generate fmt lint test-unit test-e2e # HELP Run all tests.
171178
@@ -231,9 +238,9 @@ test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suit
231238
232239.PHONY : extension-developer-e2e
233240extension-developer-e2e : KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
234- extension-developer-e2e : KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e   # EXHELP Run extension-developer e2e on local kind cluster 
235- extension-developer-e2e : export INSTALL_DEFAULT_CATALOGS := false   # EXHELP Run extension-developer e2e on local kind cluster 
236- extension-developer-e2e : run image-registry test-ext-dev-e2e kind-clean
241+ extension-developer-e2e : KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e
242+ extension-developer-e2e : export INSTALL_DEFAULT_CATALOGS := false
243+ extension-developer-e2e : run image-registry test-ext-dev-e2e kind-clean  # EXHELP Run extension-developer e2e on local kind cluster 
237244
238245.PHONY : run-latest-release
239246run-latest-release :
@@ -257,10 +264,12 @@ test-upgrade-e2e: kind-cluster run-latest-release image-registry pre-upgrade-set
257264e2e-coverage :
258265	COVERAGE_OUTPUT=./coverage/e2e.out ./hack/test/e2e-coverage.sh
259266
267+ # SECTION KIND Cluster Operations
268+ 
260269.PHONY : kind-load
261270kind-load : $(KIND )  # EXHELP Loads the currently constructed images into the KIND cluster.
262- 	$(CONTAINER_RUNTIME )  save $(IMG )  |  $(KIND )  load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME ) 
263- 	IMAGE_REPO= $( CATALOG_IMAGE_REPO )  KIND_CLUSTER_NAME= $( KIND_CLUSTER_NAME )   $( MAKE )  -C catalogd kind-load 
271+ 	$(CONTAINER_RUNTIME )  save $(OPCON_IMG )  |  $(KIND )  load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME ) 
272+ 	$( CONTAINER_RUNTIME )  save  $( CATD_IMG )   |   $( KIND )  load image-archive /dev/stdin --name  $( KIND_CLUSTER_NAME ) 
264273
265274.PHONY : kind-deploy
266275kind-deploy : export MANIFEST := ./operator-controller.yaml
@@ -300,8 +309,9 @@ export GO_BUILD_FLAGS :=
300309export  GO_BUILD_LDFLAGS  := -s -w \ 
301310    -X '$(VERSION_PATH ) .version=$(VERSION ) ' \ 
302311
303- BINARIES =operator-controller
312+ BINARIES =operator-controller catalogd 
304313
314+ .PHONY : $(BINARIES ) 
305315$(BINARIES ) 
306316	go build $(GO_BUILD_FLAGS )  -tags ' $(GO_BUILD_TAGS)' ' $(GO_BUILD_LDFLAGS)' ' $(GO_BUILD_GCFLAGS)' ' $(GO_BUILD_ASMFLAGS)' $(BUILDBIN ) /$@  ./cmd/$@ 
307317
@@ -323,15 +333,15 @@ go-build-linux: $(BINARIES)
323333.PHONY : run
324334run : docker-build kind-cluster kind-load kind-deploy wait # HELP Build the operator-controller then deploy it into a new kind cluster.
325335
326- CATALOGD_NAMESPACE  := olmv1-system
336+ CATD_NAMESPACE  := olmv1-system
327337wait :
328- 	kubectl wait  --for=condition=Available --namespace=$(CATALOGD_NAMESPACE )  deployment/catalogd-controller-manager --timeout=60s
329- 	kubectl wait  --for=condition=Ready --namespace=$(CATALOGD_NAMESPACE )  certificate/catalogd-service-cert #  Avoid upgrade test flakes when reissuing cert
338+ 	kubectl wait  --for=condition=Available --namespace=$(CATD_NAMESPACE )  deployment/catalogd-controller-manager --timeout=60s
339+ 	kubectl wait  --for=condition=Ready --namespace=$(CATD_NAMESPACE )  certificate/catalogd-service-cert #  Avoid upgrade test flakes when reissuing cert
330340
331341.PHONY : docker-build
332- docker-build : build-linux   # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
333- 	$(CONTAINER_RUNTIME )  build -t $(IMG )  -f Dockerfile ./bin/linux
334- 	IMAGE_REPO= $( CATALOG_IMAGE_REPO )   $( MAKE )C  catalogd build-container 
342+ docker-build : build-linux # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
343+ 	$(CONTAINER_RUNTIME )  build -t $(OPCON_IMG )  -f Dockerfile.operator-controller  ./bin/linux
344+ 	$( CONTAINER_RUNTIME )  build -t  $( CATD_IMG )f Dockerfile. catalogd ./bin/linux 
335345
336346# SECTION Release
337347ifeq  ($(origin ENABLE_RELEASE_PIPELINE ) , undefined)
@@ -346,7 +356,7 @@ export GORELEASER_ARGS
346356
347357.PHONY : release
348358release : $(GORELEASER )  # EXHELP Runs goreleaser for the operator-controller. By default, this will run only as a snapshot and will not publish any artifacts unless it is run with different arguments. To override the arguments, run with "GORELEASER_ARGS=...". When run as a github action from a tag, this target will publish a full release.
349- 	OPERATOR_CONTROLLER_IMAGE_REPO =$(IMAGE_REPO )   CATALOGD_IMAGE_REPO =$(CATALOG_IMAGE_REPO )  $(GORELEASER )  $(GORELEASER_ARGS ) 
359+ 	OPCON_IMAGE_REPO =$(OPCON_IMAGE_REPO )   CATD_IMAGE_REPO =$(CATD_IMAGE_REPO )  $(GORELEASER )  $(GORELEASER_ARGS ) 
350360
351361.PHONY : quickstart
352362quickstart : export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION ) /operator-controller.yaml
@@ -358,13 +368,13 @@ quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation rel
358368# #@ Docs
359369
360370.PHONY : crd-ref-docs
361- OPERATOR_CONTROLLER_API_REFERENCE_FILENAME  := operator-controller-api-reference.md
371+ API_REFERENCE_FILENAME  := operator-controller-api-reference.md
362372API_REFERENCE_DIR  := $(ROOT_DIR ) /docs/api-reference
363373crd-ref-docs : $(CRD_REF_DOCS )  # EXHELP Generate the API Reference Documents.
364- 	rm -f $(API_REFERENCE_DIR ) /$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME ) 
374+ 	rm -f $(API_REFERENCE_DIR ) /$(API_REFERENCE_FILENAME ) 
365375	$(CRD_REF_DOCS )  --source-path=$(ROOT_DIR ) /api/ \ 
366376	--config=$(API_REFERENCE_DIR ) /crd-ref-docs-gen-config.yaml \ 
367- 	--renderer=markdown --output-path=$(API_REFERENCE_DIR ) /$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME ) ; 
377+ 	--renderer=markdown --output-path=$(API_REFERENCE_DIR ) /$(API_REFERENCE_FILENAME ) ; 
368378
369379VENVDIR  := $(abspath  docs/.venv) 
370380
0 commit comments