Skip to content

Commit b3e5f58

Browse files
committed
detect better whether CC chart is installed
1 parent 1ad856e commit b3e5f58

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ checkDockerRunning() {
2828
fi
2929
}
3030

31-
## Check the version of the installed CC helm chart
32-
# $1 CC version
31+
## Check the appVersion of the CC helm chart in docker.io
32+
# $1 CC tag in docker.io
3333
checkCurrentVersion() {
3434
[ -z "$1" -o "$1" = current ] || ARG="--version $1"
3535
V=`helm show all oci://docker.io/vaadin/control-center $ARG 2>&1 | grep "^appVersion" | cut -d " " -f2`
@@ -38,6 +38,8 @@ checkCurrentVersion() {
3838
echo $V
3939
}
4040

41+
42+
4143
## Given a platform version check what is the corresponding CC version
4244
# $1 platform version
4345
computeCCVersion() {
@@ -51,6 +53,11 @@ computeCCVersion() {
5153
mvn help:evaluate -Dexpression=project.version -q -DforceStdout
5254
}
5355

56+
## Check whether the control-center chart is installed and display info
57+
isCCInstalled() {
58+
helm list -n control-center | grep -v "^NAME" | awk '{print " · "$9" · "$10" · "$4}'
59+
}
60+
5461
## If the process fails, download the logs of the apps running for inclussion in the CI artifact
5562
downloadLogs() {
5663
# this is run after a failure, thus always fail
@@ -157,7 +164,7 @@ hasCCNs() {
157164
uninstallCC() {
158165
hasCCNs || return 0
159166
[ -n "$VERBOSE" ] && HD=--debug && KD=--v=10
160-
runCmd -q "Uninstalling Control-Center" helm uninstall control-center --wait -n $CC_NS $HD
167+
H=`isCCInstalled` && runCmd -q "Uninstalling $H" helm uninstall control-center --wait -n $CC_NS $HD
161168
runCmd -q "Removing namespace $CC_NS" kubectl delete ns $CC_NS $KD $1
162169
}
163170

@@ -292,10 +299,7 @@ runControlCenter() {
292299
## Install Control Center
293300
installCC $1 || return 1
294301

295-
if [ -z "$TEST" ]; then
296-
H=`helm list -n control-center` || return 1
297-
log "Installed Control-Center is:\n$H"
298-
fi
302+
[ -z "$TEST" ] && H=`isCCInstalled` && log "Installed Control-Center is: $H"
299303

300304
## Control center takes a long time to start
301305
waitForCC 900 || return 1

0 commit comments

Comments
 (0)