-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Fix bug in port-forward.sh #5895
Changes from all commits
dfeb183
66c97b3
37073bc
7e65652
4ea6c89
d31f848
16e837b
adeba8d
519bdaf
bb06d6d
867c395
2df10f1
5df78d9
8d4a3dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- v* | ||
branches: | ||
- master | ||
- dev-* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert - we should be creating image on |
||
|
||
defaults: | ||
run: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,56 +3,56 @@ set -eu -o pipefail | |
|
||
pf() { | ||
set -eu -o pipefail | ||
name=$1 | ||
resource=$2 | ||
port=$3 | ||
resource=$1 | ||
port=$2 | ||
dest_port=${4:-"$port"} | ||
./hack/free-port.sh $port | ||
kubectl -n argo port-forward "$resource" "$port:$dest_port" > /dev/null & | ||
# wait until port forward is established | ||
echo "port-forward $resource $port" | ||
kubectl -n argo port-forward "svc/$resource" "$port:$dest_port" > /dev/null & | ||
until lsof -i ":$port" > /dev/null ; do sleep 1s ; done | ||
info "$name on http://localhost:$port" | ||
} | ||
|
||
info() { | ||
echo '[INFO] ' "$@" | ||
wait-for() { | ||
set -eu -o pipefail | ||
echo "wait-for $1" | ||
kubectl -n argo wait --timeout 1m --for=condition=Available deploy/$1 | ||
} | ||
|
||
if [[ "$(kubectl -n argo get pod -l app=minio -o name)" != "" ]]; then | ||
pf MinIO deploy/minio 9000 | ||
fi | ||
wait-for minio | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. builds were failing because we need to wait for pods to be ready (which is the same as deployment being available) before starting port-forward |
||
pf minio 9000 | ||
|
||
dex=$(kubectl -n argo get pod -l app=dex -o name) | ||
if [[ "$dex" != "" ]]; then | ||
pf DEX svc/dex 5556 | ||
wait-for dex | ||
pf dex 5556 | ||
fi | ||
|
||
postgres=$(kubectl -n argo get pod -l app=postgres -o name) | ||
if [[ "$postgres" != "" ]]; then | ||
pf Postgres "$postgres" 5432 | ||
wait-for postgres | ||
pf postgres 5432 | ||
fi | ||
|
||
mysql=$(kubectl -n argo get pod -l app=mysql -o name) | ||
if [[ "$mysql" != "" ]]; then | ||
kubectl -n argo wait --for=condition=Available deploy mysql | ||
pf MySQL "$mysql" 3306 | ||
wait-for mysql | ||
pf mysql 3306 | ||
fi | ||
|
||
if [[ "$(kubectl -n argo get pod -l app=argo-server -o name)" != "" ]]; then | ||
kubectl -n argo wait --for=condition=Available deploy argo-server | ||
pf "Argo Server" svc/argo-server 2746 | ||
wait-for argo-server | ||
pf argo-server 2746 | ||
fi | ||
|
||
if [[ "$(kubectl -n argo get pod -l app=workflow-controller -o name)" != "" ]]; then | ||
kubectl -n argo wait --for=condition=Available deploy workflow-controller | ||
pf "Workflow Controller Metrics" svc/workflow-controller-metrics 9090 | ||
wait-for workflow-controller | ||
pf workflow-controller-metrics 9090 | ||
if [[ "$(kubectl -n argo get svc -l app=workflow-controller-pprof -o name)" != "" ]]; then | ||
pf "Workflow Controller PProf" svc/workflow-controller-pprof 6060 | ||
pf workflow-controller-pprof 6060 | ||
fi | ||
fi | ||
|
||
if [[ "$(kubectl -n argo get pod -l app=prometheus -o name)" != "" ]]; then | ||
kubectl -n argo wait --for=condition=Available deploy prometheus | ||
pf "Prometheus Server" svc/prometheus 9091 9090 | ||
wait-for prometheus | ||
pf prometheus 9091 9090 | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order of redirect here meant stderr was not being captured, which made this time-consuming to debug