Skip to content

Commit cdf3857

Browse files
authored
Add local platform mesh kind setup (#53)
* add local platform mesh setup target Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com * fix platform setup Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com * add ocm setup for httpbin operator Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
1 parent be10f5e commit cdf3857

6 files changed

Lines changed: 865 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ Chart.lock
3636
charts/**/*.tar.gz
3737
charts/**/*.tgz
3838
/dist
39+
.helm-charts

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ GO ?= go
22
KUBECTL ?= kubectl
33
KIND ?= kind
44
HELM ?= helm
5+
TASK ?= task
56
KUSTOMIZE ?= $(GO) tool kustomize
67
CONTROLLER_GEN ?= $(GO) tool controller-gen
78
API_GEN ?= $(GO) tool apigen
@@ -231,3 +232,26 @@ kind-test-sample: ## Deploy a sample httpbin to test the operator
231232
.PHONY: kind-test-e2e
232233
kind-test-e2e: kind-test
233234
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" IMG=$(IMG) go test ./test/... -v -timeout 30m $(if $(TEST_NAME),-run "^$(TEST_NAME)$$")
235+
236+
.PHONY: local-platform-mesh
237+
local-platform-mesh: setup-hosts ## Install local platform mesh components
238+
rm -rf .helm-charts || true
239+
git clone https://github.com/platform-mesh/helm-charts.git -o platform-mesh .helm-charts
240+
cp hack/ocm/Taskfile.yaml .helm-charts/Taskfile.yaml
241+
cp hack/ocm/component-constructor-prerelease.yaml .helm-charts/.ocm/component-constructor-prerelease.yaml
242+
cd .helm-charts && $(TASK) local-setup-cached
243+
@echo "preparing ocm deployment..."
244+
cd .helm-charts && $(TASK) ocm:deploy
245+
cd .helm-charts && $(TASK) ocm:build ocm:apply
246+
cp hack/ocm/platform-mesh.yaml .helm-charts/local-setup/kustomize/components/platform-mesh-operator-resource/platform-mesh.yaml
247+
cd .helm-charts && $(TASK) local-setup-cached:iterate
248+
249+
250+
.PHONY: setup-hosts
251+
setup-hosts: ## Add local development hosts to /etc/hosts
252+
@echo "Adding development hosts to /etc/hosts..."
253+
@if ! grep -q "portal.dev.local" /etc/hosts; then \
254+
echo "127.0.0.1 demo.portal.dev.local default.portal.dev.local portal.dev.local kcp.api.portal.dev.local" | sudo tee -a /etc/hosts; \
255+
else \
256+
echo "Hosts already configured"; \
257+
fi

charts/example-httpbin-operator/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Default values for example-httpbin-operator
2-
2+
enabled: true
33
nameOverride: ""
44
fullnameOverride: ""
55

@@ -26,6 +26,7 @@ operator:
2626

2727
# Image configuration
2828
image:
29+
name: ghcr.io/platform-mesh/example-httpbin-operator
2930
registry: ghcr.io
3031
repository: platform-mesh/example-httpbin-operator
3132
tag: 0.1.0

0 commit comments

Comments
 (0)