Skip to content

Commit

Permalink
Align Makefile use of IMG:TAG w/ other controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
Paulo Gomes committed Jan 18, 2022
1 parent ccdcc6e commit bd34eca
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd34eca

Please sign in to comment.