forked from ShyamsundarR/ocm-minikube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration-operator.diff
63 lines (56 loc) · 4.06 KB
/
registration-operator.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/Makefile b/Makefile
index cb477b4..d15bd0b 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,6 @@ OLM_VERSION?=0.16.1
KUBECTL?=kubectl
KUBECONFIG?=./.kubeconfig
KLUSTERLET_KUBECONFIG_CONTEXT?=$(shell $(KUBECTL) config current-context)
-KLUSTERLET_KIND_KUBECONFIG?=$(HOME)/cluster1-kubeconfig
HUB_KIND_KUBECONFIG?=$(HOME)/hub-kubeconfig
MANAGED_CLUSTER?=cluster1
HUB_CLUSTER?=hub
@@ -101,7 +100,7 @@ install-olm: ensure-operator-sdk
$(KUBECTL) get ns open-cluster-management ; if [ $$? -ne 0 ] ; then $(KUBECTL) create ns open-cluster-management ; fi
install-olm-kind: ensure-operator-sdk
- $(KUBECTL) config use-context kind-$(MANAGED_CLUSTER)
+ $(KUBECTL) config use-context $(MANAGED_CLUSTER)
$(KUBECTL) get crds | grep clusterserviceversion ; if [ $$? -ne 0 ] ; then $(OPERATOR_SDK) olm install --version $(OLM_VERSION); fi
$(KUBECTL) get ns open-cluster-management ; if [ $$? -ne 0 ] ; then $(KUBECTL) create ns open-cluster-management ; fi
@@ -127,15 +126,15 @@ bootstrap-secret: cluster-ip
cp $(KUBECONFIG) dev-kubeconfig
$(KUBECTL) config use-context $(KLUSTERLET_KUBECONFIG_CONTEXT)
$(KUBECTL) get ns open-cluster-management-agent; if [ $$? -ne 0 ] ; then $(KUBECTL) create ns open-cluster-management-agent; fi
- $(KUBECTL) config set clusters.kind-$(MANAGED_CLUSTER).server https://$(CLUSTER_IP) --kubeconfig dev-kubeconfig
+ $(KUBECTL) config set clusters.$(MANAGED_CLUSTER).server https://$(CLUSTER_IP) --kubeconfig dev-kubeconfig
$(KUBECTL) delete secret bootstrap-hub-kubeconfig -n open-cluster-management-agent --ignore-not-found
$(KUBECTL) create secret generic bootstrap-hub-kubeconfig --from-file=kubeconfig=dev-kubeconfig -n open-cluster-management-agent
bootstrap-secret-kind: cluster-hub-ip-kind
cp $(HUB_KIND_KUBECONFIG) dev-kubeconfig
- $(KUBECTL) config use-context kind-$(MANAGED_CLUSTER)
+ $(KUBECTL) config use-context $(MANAGED_CLUSTER)
$(KUBECTL) get ns open-cluster-management-agent; if [ $$? -ne 0 ] ; then $(KUBECTL) create ns open-cluster-management-agent; fi
- $(KUBECTL) --kubeconfig dev-kubeconfig config set clusters.kind-$(HUB_CLUSTER).server https://$(CLUSTER_IP_KIND)
+ $(KUBECTL) --kubeconfig dev-kubeconfig config set clusters.$(HUB_CLUSTER).server https://$(CLUSTER_IP_KIND)
$(KUBECTL) delete secret bootstrap-hub-kubeconfig -n open-cluster-management-agent --ignore-not-found
$(KUBECTL) create secret generic bootstrap-hub-kubeconfig --from-file=kubeconfig=dev-kubeconfig -n open-cluster-management-agent
@@ -143,7 +142,7 @@ bootstrap-secret-kind: cluster-hub-ip-kind
# TODO: think about how to factor this
e2e-bootstrap-secret: cluster-ip
cp $(KUBECONFIG) e2e-kubeconfig
- $(KUBECTL) config set clusters.kind-kind.server https://$(CLUSTER_IP) --kubeconfig e2e-kubeconfig
+ $(KUBECTL) config set clusters.kind.server https://$(CLUSTER_IP) --kubeconfig e2e-kubeconfig
$(KUBECTL) delete secret e2e-bootstrap-secret -n open-cluster-management --ignore-not-found
$(KUBECTL) create secret generic e2e-bootstrap-secret --from-file=kubeconfig=e2e-kubeconfig -n open-cluster-management
@@ -161,8 +160,11 @@ apply-spoke-cr:
$(SED_CMD) -e "s,quay.io/open-cluster-management/registration,$(REGISTRATION_IMAGE)," -e "s,quay.io/open-cluster-management/work,$(WORK_IMAGE)," deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml | $(KUBECTL) apply -f -
apply-spoke-cr-kind:
- $(KUBECTL) config use-context kind-$(MANAGED_CLUSTER)
- $(KUBECTL) apply -f deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml
+ mkdir -p munge-csv
+ cp deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml munge-csv/operator_open-cluster-management_klusterlets.cr.yaml
+ $(SED_CMD) -e "s,cluster1,$(MANAGED_CLUSTER)," -i munge-csv/operator_open-cluster-management_klusterlets.cr.yaml
+ $(KUBECTL) config use-context $(MANAGED_CLUSTER)
+ $(KUBECTL) apply -f munge-csv/operator_open-cluster-management_klusterlets.cr.yaml
clean-spoke: ensure-operator-sdk
$(KUBECTL) delete -f deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml --ignore-not-found