From bd34eca09a04347f69078d209664b64c8955c689 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Tue, 18 Jan 2022 18:08:06 +0000 Subject: [PATCH] Align Makefile use of IMG:TAG w/ other controllers Signed-off-by: Paulo Gomes --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 95c3e33ab..9cfbd3224 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ # Image URL to use all building/pushing image targets -IMG ?= fluxcd/helm-controller:latest +IMG ?= fluxcd/helm-controller +TAG ?= latest + # Produce CRDs that work back to Kubernetes 1.16 CRD_OPTIONS ?= crd:crdVersions=v1 @@ -44,20 +46,20 @@ uninstall: manifests # Deploy controller in the configured Kubernetes cluster in ~/.kube/config deploy: manifests - cd config/manager && kustomize edit set image fluxcd/helm-controller=${IMG} + cd config/manager && kustomize edit set image fluxcd/helm-controller=$(IMG):$(TAG) kustomize build config/default | kubectl apply -f - # Deploy controller dev image in the configured Kubernetes cluster in ~/.kube/config dev-deploy: manifests mkdir -p config/dev && cp config/default/* config/dev - cd config/dev && kustomize edit set image fluxcd/helm-controller=${IMG} + cd config/dev && kustomize edit set image fluxcd/helm-controller=$(IMG):$(TAG) kustomize build config/dev | kubectl apply -f - rm -rf config/dev # Delete dev deployment and CRDs dev-cleanup: manifests mkdir -p config/dev && cp config/default/* config/dev - cd config/dev && kustomize edit set image fluxcd/helm-controller=${IMG} + cd config/dev && kustomize edit set image fluxcd/helm-controller=$(IMG):$(TAG) kustomize build config/dev | kubectl delete -f - rm -rf config/dev @@ -93,13 +95,12 @@ generate: controller-gen docker-build: docker buildx build \ --platform=$(BUILD_PLATFORMS) \ - -t ${IMG} \ - --load \ + -t $(IMG):$(TAG) \ ${BUILD_ARGS} . # Push the docker image docker-push: - docker push ${IMG} + docker push $(IMG):$(TAG) # Find or download controller-gen CONTROLLER_GEN = $(shell pwd)/bin/controller-gen