Skip to content

Commit

Permalink
check port
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Jan 15, 2025
1 parent a53b4f3 commit f96ae78
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/pit/lib/lib-cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,26 @@ stopCloudProvider() {
startPortForward() {
[ -z "$3" ] && echo "startPortForward name-space service port" && return 1
H=`getPids "kubectl port-forward $2"`
set -x
sudo ls
id
echo "$H"
[ -n "$H" ] && return 0
f=/tmp/kubectl-port-forward.logs
touch $f

port="${4:-3}"
log "Starting k8s port-forward $1 $2 -> ${3:-2}"
set -x
if [ "$port" -le 1024 ];
then
cmd=`which kubectl`" port-forward $2 $port:$3 -n $1 > /tmp/kubectl-port-forward.logs 2>&1 &"
cmd=`which kubectl`" port-forward $2 $port:$3 -n $1 > $f 2>&1 &"
echo "# $cmd"
sudo bash -c "$cmd"
sleep 5
cat $f
else
kubectl port-forward $2 $port:$3 -n $1 > /tmp/kubectl-port-forward.logs 2>&1 &
kubectl port-forward $2 $port:$3 -n $1 > $f 2>&1 &
fi
}

Expand Down Expand Up @@ -190,10 +198,11 @@ runControlCenter() {
installCC || waitForCC 400 || return 1
[ -n "$CC_KEY" -a -n "$CC_CERT" ] && installTls || return 1
forwardIngress || return 1
sleep 2
tmp_pass=`kubectl -n $CC_NS get secret control-center-user -o go-template="{{ .data.password | base64decode | println }}"`
log "Control Center installed, login to https://$CC_CONTROL with the username $CC_EMAIL and password: $tmp_pass"
test=`computeAbsolutePath`/its/cc-setup.js
echo "$test"
checkPort 443 || return 1
runPlaywrightTests "$test" "" "prod" "control-center" --url=https://$CC_CONTROL --email=$CC_EMAIL
deleteCluster
;;
Expand Down

0 comments on commit f96ae78

Please sign in to comment.