Skip to content

Commit 22caf00

Browse files
makefile fixes
Signed-off-by: jamesmilligan <[email protected]>
1 parent 740898b commit 22caf00

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
# Image URL to use all building/pushing image targets
33
IMG ?= controller:latest
4-
# Path to the kustomize directory used for building the release yaml
5-
KUSTOMIZE_PATH ?= config/default
4+
# customize overlay to be used in the build, DEFAULT or HELM
5+
KUSTOMIZE_OVERLAY ?= DEFAULT
66
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
77
FLAGD_VERSION=v0.2.5
8-
CHART_VERSION=v0.2.16# x-release-please-version
8+
CHART_VERSION=v0.2.16# x-release-please-vers ion
99
ENVTEST_K8S_VERSION = 1.23
1010

1111
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
@@ -107,7 +107,14 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
107107
release-manifests: manifests kustomize
108108
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
109109
mkdir -p config/rendered/
110-
$(KUSTOMIZE) build ${KUSTOMIZE_PATH} > config/rendered/release.yaml
110+
@if [ ${KUSTOMIZE_OVERLAY} = DEFAULT ]; then\
111+
echo building default overlay;\
112+
$(KUSTOMIZE) build config/default > config/rendered/release.yaml;\
113+
fi
114+
@if [ ${KUSTOMIZE_OVERLAY} = HELM ]; then\
115+
echo building helm overlay;\
116+
$(KUSTOMIZE) build config/overlays/helm > config/rendered/release.yaml;\
117+
fi
111118

112119
.PHONY: deploy
113120
deploy: generate manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
@@ -168,7 +175,11 @@ $(HELM): $(LOCALBIN)
168175
[ -e "$(HELM)" ] && rm -rf "$(HELM)" || true
169176
cd $(LOCALBIN) && curl -s $(HELM_INSTALLER) | tar -xzf - -C $(LOCALBIN)
170177

171-
helm-package: generate release-manifests helm
178+
.PHONY: set-helm-overlay
179+
set-helm-overlay:
180+
KUSTOMIZE_OVERLAY=HELM
181+
182+
helm-package: set-helm-overlay generate release-manifests helm
172183
cp config/rendered/release.yaml chart/templates/rendered.yaml
173184
$(HELM) package --version $(CHART_VERSION) chart
174185
mkdir -p charts && mv ofo-*.tgz charts

0 commit comments

Comments
 (0)