@@ -14,8 +14,7 @@ CC_TLS_K=cc-control-login-tls
14
14
# # Ingress names
15
15
CC_ING_A=control-center
16
16
CC_ING_K=control-center-keycloak-ingress
17
- # # K8s cluster and namespace
18
- CC_CLUSTER=cc-cluster
17
+ # Namespace used for CC
19
18
CC_NS=control-center
20
19
21
20
# # UI tests to run after the control-center is installed
@@ -160,7 +159,7 @@ runPwTests() {
160
159
}
161
160
162
161
setClusterContext () {
163
- [ " $1 " = " $CC_CLUSTER " ] && current=kind-$1 || current=$1
162
+ [ " $1 " = " $KIND_CLUSTER " ] && current=kind-$1 || current=$1
164
163
ns=$2
165
164
H=` kubectl config get-contexts | tr ' *' ' ' | awk ' {print $1}' | egrep " ^$current $" `
166
165
[ -z " $H " ] && log " Cluster $current not found in kubectl contexts" && return 1
@@ -173,13 +172,13 @@ setClusterContext() {
173
172
174
173
# # Main method for running control center
175
174
runControlCenter () {
176
- CLUSTER=${CLUSTER:- $CC_CLUSTER }
175
+ CLUSTER=${CLUSTER:- $KIND_CLUSTER }
177
176
178
177
checkCommands docker kubectl helm unzip || return 1
179
178
checkDockerRunning || return 1
180
179
181
180
# # Start a new kind cluster if needed
182
- [ " $CLUSTER " != " $CC_CLUSTER " ] || createKindCluster $CC_CLUSTER $CC_NS || return 1
181
+ [ " $CLUSTER " != " $KIND_CLUSTER " ] || createKindCluster $CLUSTER $CC_NS || return 1
183
182
184
183
# # Set the context to the cluster
185
184
setClusterContext " $CLUSTER " " $CC_NS " || return 1
@@ -204,10 +203,11 @@ runControlCenter() {
204
203
205
204
# # Run Playwright tests for the control-center
206
205
runPwTests || return 1
207
- if [ -z " $TEST " -a -z " $KEEPCC " ]; then
208
- stopForwardIngress || return 1
209
- [ " $CLUSTER " != " $CC_CLUSTER " ] || deleteKindCluster $CC_CLUSTER || return 1
210
- fi
206
+ stopForwardIngress || return 1
207
+
208
+ # # Delete the KinD cluster if it was created in this test
209
+ [ -n " $TEST " -o -n " $KEEPCC " -o " $CLUSTER " != " $KIND_CLUSTER " ] || deleteKindCluster " $CLUSTER " || return 1
210
+
211
211
return 0
212
212
}
213
213
0 commit comments