Skip to content

Commit 72bd79d

Browse files
committed
rename vars
1 parent af42337 commit 72bd79d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

scripts/pit/lib/lib-ccenter.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ CC_TLS_K=cc-control-login-tls
1414
## Ingress names
1515
CC_ING_A=control-center
1616
CC_ING_K=control-center-keycloak-ingress
17-
## K8s cluster and namespace
18-
CC_CLUSTER=cc-cluster
17+
# Namespace used for CC
1918
CC_NS=control-center
2019

2120
## UI tests to run after the control-center is installed
@@ -160,7 +159,7 @@ runPwTests() {
160159
}
161160

162161
setClusterContext() {
163-
[ "$1" = "$CC_CLUSTER" ] && current=kind-$1 || current=$1
162+
[ "$1" = "$KIND_CLUSTER" ] && current=kind-$1 || current=$1
164163
ns=$2
165164
H=`kubectl config get-contexts | tr '*' ' ' | awk '{print $1}' | egrep "^$current$"`
166165
[ -z "$H" ] && log "Cluster $current not found in kubectl contexts" && return 1
@@ -173,13 +172,13 @@ setClusterContext() {
173172

174173
## Main method for running control center
175174
runControlCenter() {
176-
CLUSTER=${CLUSTER:-$CC_CLUSTER}
175+
CLUSTER=${CLUSTER:-$KIND_CLUSTER}
177176

178177
checkCommands docker kubectl helm unzip || return 1
179178
checkDockerRunning || return 1
180179

181180
## 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
183182

184183
## Set the context to the cluster
185184
setClusterContext "$CLUSTER" "$CC_NS" || return 1
@@ -204,10 +203,11 @@ runControlCenter() {
204203

205204
## Run Playwright tests for the control-center
206205
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+
211211
return 0
212212
}
213213

scripts/pit/lib/lib-k8s-kind.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
. `dirname $0`/lib/lib-utils.sh
22

3+
## Kind cluster to use if not provided
4+
KIND_CLUSTER=cc-cluster
5+
36
## Check that the command has SUID bit set
47
# $1: command
58
hasSUID() {

0 commit comments

Comments
 (0)