Skip to content

Commit

Permalink
rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Jan 30, 2025
1 parent af42337 commit 72bd79d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/pit/lib/lib-ccenter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ CC_TLS_K=cc-control-login-tls
## Ingress names
CC_ING_A=control-center
CC_ING_K=control-center-keycloak-ingress
## K8s cluster and namespace
CC_CLUSTER=cc-cluster
# Namespace used for CC
CC_NS=control-center

## UI tests to run after the control-center is installed
Expand Down Expand Up @@ -160,7 +159,7 @@ runPwTests() {
}

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

## Main method for running control center
runControlCenter() {
CLUSTER=${CLUSTER:-$CC_CLUSTER}
CLUSTER=${CLUSTER:-$KIND_CLUSTER}

checkCommands docker kubectl helm unzip || return 1
checkDockerRunning || return 1

## Start a new kind cluster if needed
[ "$CLUSTER" != "$CC_CLUSTER" ] || createKindCluster $CC_CLUSTER $CC_NS || return 1
[ "$CLUSTER" != "$KIND_CLUSTER" ] || createKindCluster $CLUSTER $CC_NS || return 1

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

## Run Playwright tests for the control-center
runPwTests || return 1
if [ -z "$TEST" -a -z "$KEEPCC" ]; then
stopForwardIngress || return 1
[ "$CLUSTER" != "$CC_CLUSTER" ] || deleteKindCluster $CC_CLUSTER || return 1
fi
stopForwardIngress || return 1

## Delete the KinD cluster if it was created in this test
[ -n "$TEST" -o -n "$KEEPCC" -o "$CLUSTER" != "$KIND_CLUSTER" ] || deleteKindCluster "$CLUSTER" || return 1

return 0
}

Expand Down
3 changes: 3 additions & 0 deletions scripts/pit/lib/lib-k8s-kind.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
. `dirname $0`/lib/lib-utils.sh

## Kind cluster to use if not provided
KIND_CLUSTER=cc-cluster

## Check that the command has SUID bit set
# $1: command
hasSUID() {
Expand Down

0 comments on commit 72bd79d

Please sign in to comment.