This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
forked from openshift/console-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_run_local.sh
executable file
·101 lines (78 loc) · 2.43 KB
/
dev_run_local.sh
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env bash
# we need to be system admin to install these
oc login -u system:admin
# this just deploys everything under /manifests,
# but tries to space them out a bit to avoid errors.
# in the end, it creates a custom resource to kick
# the operator into action
# necessary if doing dev locally on a < 4.0.0 cluster
CLUSTER_OPERATOR_CRD_FILE="./examples/crd-clusteroperator.yaml"
echo "creating ${CLUSTER_OPERATOR_CRD_FILE}"
oc create -f "${CLUSTER_OPERATOR_CRD_FILE}"
# examples/cr.yaml is not necessary as the operator will create
# an instance of a "console" by default.
# use it if customization is desired.
for FILE in `find ./manifests -name '00-*'`
do
echo "creating ${FILE}"
oc create -f $FILE
done
sleep 1
for FILE in `find ./manifests -name '01-*'`
do
echo "creating ${FILE}"
oc create -f $FILE
done
sleep 2
# use the openshift-console project, for
# - when we create the CR (namespace: should be defined in the resource anyway)
# - when we run the operator locally.
oc project 'openshift-console'
for FILE in `find ./manifests -name '02-*'`
do
echo "creating ${FILE}"
oc create -f $FILE
done
sleep 1
for FILE in `find ./manifests -name '03-*'`
do
echo "creating ${FILE}"
oc create -f $FILE
done
sleep 1
for FILE in `find ./manifests -name '04-*'`
do
echo "creating ${FILE}"
oc create -f $FILE
done
sleep 1
# at this point, we should no longer be system:admin
# oc login -u developer -p 12345
# ensure the latest binary has been built
make build
# Don't deploy the operator in `manifests`
# instead, we will instantiate the operator locally
#
#for FILE in `find ./manifests -name '05-*'`
#do
# echo "creating ${FILE}"
# oc create -f $FILE
#done
# temporaily add the binary to path so we can call it below
export PATH="$PATH:$HOME/gopaths/consoleoperator/src/github.com/openshift/console-operator/_output/local/bin/darwin/amd64"
#IMAGE=docker.io/openshift/origin-console:latest \
# console operator \
# --kubeconfig $HOME/.kube/config \
# --config examples/config.yaml \
# --v 4
echo "TODO: support --create-default-console again!"
# TODO: GET BACK TO THIS:
IMAGE=docker.io/openshift/origin-console:latest \
console operator \
--kubeconfig $HOME/.kube/config \
--config examples/config.yaml \
--create-default-console \
--v 4
# NOT creating the CR as the operator should create one automatically.
# echo "Creating the CR to activate the operator"
# oc create -f "./examples/cr.yaml"