Skip to content

Commit 4c9466a

Browse files
tedhtchangSrihari1192
authored andcommitted
gsed support for MacOs
1 parent 3e8f3e7 commit 4c9466a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,26 @@ endif
188188

189189
.PHONY: install
190190
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
191-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
191+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
192192
$(KUSTOMIZE) build config/crd | kubectl apply -f -
193193
git restore config/*
194194

195195
.PHONY: uninstall
196196
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.
197-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
197+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
198198
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
199199
git restore config/*
200200

201201
.PHONY: deploy
202202
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
203-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
203+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
204204
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
205205
$(KUSTOMIZE) build config/default | kubectl apply -f -
206206
git restore config/*
207207

208208
.PHONY: undeploy
209209
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.
210-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
210+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
211211
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
212212
git restore config/*
213213

@@ -225,6 +225,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
225225
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN)/openshift-goimports
226226
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
227227
GH_CLI ?= $(LOCALBIN)/gh
228+
SED ?= /usr/bin/sed
228229

229230
## Tool Versions
230231
KUSTOMIZE_VERSION ?= v4.5.4
@@ -279,7 +280,7 @@ validate-bundle: install-operator-sdk
279280
.PHONY: bundle
280281
bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
281282
$(OPERATOR_SDK) generate kustomize manifests -q
282-
sed -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
283+
$(SED) -i -E "s|(- )\${MCAD_REPO}.*|\1\${MCAD_CRD}|" config/crd/mcad/kustomization.yaml
283284
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
284285
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
285286
cd config/manifests && $(KUSTOMIZE) edit add patch --patch '[{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
@@ -346,7 +347,7 @@ catalog-build-from-index: opm ## Build a catalog image.
346347
mkdir catalog
347348
$(OPM) render $(CATALOG_BASE_IMG) -o yaml > catalog/bundles.yaml
348349
$(OPM) render $(BUNDLE_IMG) $(OPM_BUNDLE_OPT) > catalog/codeflare-operator-bundle.yaml
349-
sed -i -E "s/(.*)(- name: codeflare-operator.$(PREVIOUS_VERSION).*)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
350+
$(SED) -i -E "s/(.*)(- name: codeflare-operator.$(PREVIOUS_VERSION).*)/\1- name: codeflare-operator.$(VERSION)\n replaces: codeflare-operator.$(PREVIOUS_VERSION)\n\2/" catalog/bundles.yaml
350351
$(OPM) validate catalog
351352
$(OPM) generate dockerfile catalog
352353
podman build . -f catalog.Dockerfile -t $(CATALOG_IMG)

0 commit comments

Comments
 (0)