@@ -36,9 +36,21 @@ IMAGE_TAG_BASE ?= nginx/nginx-ingress-operator
3636# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
3737BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v$(VERSION )
3838
39+ # BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
40+ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
41+
42+ # USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
43+ # You can enable this value if you would like to use SHA Based Digests
44+ # To enable set flag to true
45+ USE_IMAGE_DIGESTS ?= false
46+ ifeq ($(USE_IMAGE_DIGESTS ) , true)
47+ BUNDLE_GEN_FLAGS += --use-image-digests
48+ endif
49+
3950# Image URL to use all building/pushing image targets
4051IMG ?= $(IMAGE_TAG_BASE ) :$(VERSION )
4152
53+ .PHONY : all
4254all : docker-build
4355
4456# #@ General
@@ -54,37 +66,45 @@ all: docker-build
5466# More info on the awk command:
5567# http://linuxcommand.org/lc3_adv_awk.php
5668
69+ .PHONY : help
5770help : # # Display this help.
5871 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
5972
6073# #@ Build
6174
75+ .PHONY : run
6276run : helm-operator # # Run against the configured Kubernetes cluster in ~/.kube/config
6377 $(HELM_OPERATOR ) run
6478
79+ .PHONY : docker-build
6580docker-build : # # Build docker image with the manager.
66- docker build -t ${IMG} . --build-arg VERSION= ${VERSION}
81+ docker build -t ${IMG} .
6782
83+ .PHONY : docker-push
6884docker-push : # # Push docker image with the manager.
6985 docker push ${IMG}
7086
7187# #@ Deployment
7288
89+ .PHONY : install
7390install : kustomize # # Install CRDs into the K8s cluster specified in ~/.kube/config.
7491 $(KUSTOMIZE ) build config/crd | kubectl apply -f -
7592
93+ .PHONY : uninstall
7694uninstall : kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
7795 $(KUSTOMIZE ) build config/crd | kubectl delete -f -
7896
97+ .PHONY : deploy
7998deploy : kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
8099 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
81100 $(KUSTOMIZE ) build config/default | kubectl apply -f -
82101
102+ .PHONY : undeploy
83103undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config.
84104 $(KUSTOMIZE ) build config/default | kubectl delete -f -
85105
86106OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
87- ARCH := $(shell uname -m | sed 's/x86_64/amd64/')
107+ ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/' )
88108
89109.PHONY : kustomize
90110KUSTOMIZE = $(shell pwd) /bin/kustomize
@@ -110,7 +130,7 @@ ifeq (,$(shell which helm-operator 2>/dev/null))
110130 @{ \
111131 set -e ;\
112132 mkdir -p $(dir $(HELM_OPERATOR)) ;\
113- curl -sSLo $(HELM_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.10.1 /helm-operator_$(OS)_$(ARCH) ;\
133+ curl -sSLo $(HELM_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.16.0 /helm-operator_$(OS)_$(ARCH) ;\
114134 chmod +x $(HELM_OPERATOR) ;\
115135 }
116136else
@@ -141,7 +161,7 @@ ifeq (,$(shell which opm 2>/dev/null))
141161 @{ \
142162 set -e ;\
143163 mkdir -p $(dir $(OPM)) ;\
144- curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.15 .1/$(OS)-$(ARCH)-opm ;\
164+ curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.19 .1/$(OS)-$(ARCH)-opm ;\
145165 chmod +x $(OPM) ;\
146166 }
147167else
@@ -172,8 +192,3 @@ catalog-build: opm ## Build a catalog image.
172192.PHONY : catalog-push
173193catalog-push : # # Push a catalog image.
174194 $(MAKE ) docker-push IMG=$(CATALOG_IMG )
175-
176- # Get medatada to prepare the bundle to be submitted at https://github.com/redhat-openshift-ecosystem/certified-operators/
177- .PHONY : get-metadata-certification
178- get-metadata-certification :
179- @./hack/get_image_info.sh ${IMAGE_TAG_BASE} ${VERSION}
0 commit comments