Skip to content

Commit

Permalink
build: don't execute kustomize installation as part of other make com…
Browse files Browse the repository at this point in the history
…mands (#751)

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Feb 2, 2023
1 parent 4e2f050 commit 48b0dbc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ $(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

.PHONY: release-helm-manifests
release-helm-manifests: kustomize
release-helm-manifests:
echo "building helm overlay"
$(KUSTOMIZE) build ./helm/overlay > ./helm/chart/templates/rendered.yaml
kustomize build ./helm/overlay > ./helm/chart/templates/rendered.yaml

.PHONY: helm-package
helm-package: build-release-manifests release-helm-manifests
Expand Down
14 changes: 7 additions & 7 deletions klt-cert-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ ifndef ignore-not-found
endif

.PHONY: deploy
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
deploy: ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && kustomize edit set image controller=${IMG}
kustomize build config/default | kubectl apply -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
kustomize build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

##@ Build Dependencies

Expand Down Expand Up @@ -184,6 +184,6 @@ push-local:
docker push $(RELEASE_REGISTRY)/$(RELEASE_IMAGE)

.PHONY: release-manifests
release-manifests: kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
$(KUSTOMIZE) build config/default > config/rendered/release.yaml
release-manifests:
cd config/manager && kustomize edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
kustomize build config/default > config/rendered/release.yaml
28 changes: 14 additions & 14 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,33 +129,33 @@ ifndef ignore-not-found
endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply --server-side -f -
install: manifests ## Install CRDs into the K8s cluster specified in ~/.kube/config.
kustomize build config/crd | kubectl apply --server-side -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
kustomize build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: release-manifests
release-manifests: manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
release-manifests: manifests
cd config/manager && kustomize edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
echo "building default overlay"
$(KUSTOMIZE) build config/default > config/rendered/release.yaml
kustomize build config/default > config/rendered/release.yaml

.PHONY: release-helm-manifests
release-helm-manifests: manifests gen-crds kustomize
release-helm-manifests: manifests gen-crds
echo "building helm overlay"
cd config/manager && $(KUSTOMIZE) edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
$(KUSTOMIZE) build config/default/base > config/rendered/release.yaml
cd config/manager && kustomize edit set image controller=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
kustomize build config/default/base > config/rendered/release.yaml

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply --server-side -f -
deploy: manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && kustomize edit set image controller=${IMG}
kustomize build config/default | kubectl apply --server-side -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
kustomize build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

##@ Build Dependencies

Expand Down
6 changes: 3 additions & 3 deletions scheduler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ $(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

.PHONY: release-manifests
release-manifests: kustomize
cd manifests/install && $(KUSTOMIZE) edit set image scheduler=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
$(KUSTOMIZE) build manifests/install > config/rendered/release.yaml
release-manifests:
cd manifests/install && kustomize edit set image scheduler=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
kustomize build manifests/install > config/rendered/release.yaml

envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
Expand Down

0 comments on commit 48b0dbc

Please sign in to comment.