Skip to content

Commit 338d27c

Browse files
authored
Sidequest: Remove technical debt (#563)
## Description * the deploy targets do not work anymore since the directory-structure does not exist. This is because the deployment needs an additionaly OCI registry. To deploy the controller one can use the instructions in the README.md * add context on how to run `make test` * cleanup
1 parent 9d5597f commit 338d27c

File tree

2 files changed

+8
-35
lines changed

2 files changed

+8
-35
lines changed

Makefile

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ lint: golangci-lint ## Run golangci-lint.
9393

9494
##@ Testing
9595

96+
# Note: Requires tinygo (0.31.2) and wasm-opt
9697
.PHONY: test
9798
test: manifests generate fmt vet build-wasm-testdata envtest ## Run tests.
9899
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
@@ -132,36 +133,6 @@ docker-build: ## Build docker image with the manager.
132133
docker-push: ## Push docker image with the manager.
133134
docker push ${IMG}:${TAG}
134135

135-
##@ Deployment
136-
137-
ifndef ignore-not-found
138-
ignore-not-found = false
139-
endif
140-
141-
.PHONY: install
142-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
143-
$(KUSTOMIZE) build config/crd | kubectl apply -f -
144-
145-
.PHONY: uninstall
146-
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.
147-
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
148-
149-
.PHONY: deploy
150-
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
151-
cd config/default && $(KUSTOMIZE) edit set image open-component-model/ocm-controller=$(IMG):$(TAG)
152-
$(KUSTOMIZE) build config/default | kubectl apply -f -
153-
154-
.PHONY: dev-deploy
155-
dev-deploy: kustomize ## Deploy controller dev image in the configured Kubernetes cluster in ~/.kube/config
156-
mkdir -p config/dev && cp -R config/default/* config/dev
157-
cd config/dev && $(KUSTOMIZE) edit set image open-component-model/ocm-controller=$(IMG):$(TAG)
158-
$(KUSTOMIZE) build config/dev | kubectl apply -f -
159-
rm -rf config/dev
160-
161-
.PHONY: undeploy
162-
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.
163-
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
164-
165136
##@ Component
166137

167138
.PHONY: plain-push

hack/prime_test_cluster.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

33
# cleanup
4-
rm -fr hack/rootCA.pem
4+
if [[ -f hack/rootCA.pem ]]; then
5+
rm hack/rootCA.pem
6+
fi
57

68
CERT_MANAGER_VERSION=${CERT_MANAGER_VERSION:-v1.13.1}
79

@@ -12,23 +14,23 @@ fi
1214

1315
kind create cluster --name=e2e-test-cluster
1416

15-
echo -n 'installing cert-manager'
17+
echo 'installing cert-manager'
1618
kubectl apply -f hack/cert-manager.yaml
1719
kubectl wait --for=condition=Available=True Deployment/cert-manager -n cert-manager --timeout=60s
1820
kubectl wait --for=condition=Available=True Deployment/cert-manager-webhook -n cert-manager --timeout=60s
1921
kubectl wait --for=condition=Available=True Deployment/cert-manager-cainjector -n cert-manager --timeout=60s
2022
echo 'done'
2123

22-
echo -n 'applying root certificate issuer'
24+
echo 'applying root certificate issuer'
2325
kubectl apply -f hack/cluster_issuer.yaml
2426
echo 'done'
2527

26-
echo -n 'waiting for root certificate to be generated...'
28+
echo 'waiting for root certificate to be generated...'
2729
kubectl wait --for=condition=Ready=true Certificate/mpas-bootstrap-certificate -n cert-manager --timeout=60s
2830
echo 'done'
2931

3032
kubectl get secret ocm-registry-tls-certs -n cert-manager -o jsonpath="{.data['tls\.crt']}" | base64 -d > hack/rootCA.pem
31-
echo -n 'installing root certificate into local trust store...'
33+
echo 'installing root certificate into local trust store...'
3234
CAROOT=hack ./bin/mkcert -install
3335
rootCAPath="./hack/rootCA.pem"
3436

0 commit comments

Comments
 (0)