Skip to content

Commit

Permalink
fix issues of pipeline-service test
Browse files Browse the repository at this point in the history
  • Loading branch information
xinredhat authored and Roming22 committed Oct 16, 2023
1 parent 0dec9db commit 81454e7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ci/images/ci-runner/hack/bin/run-plnsvc-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ if kubectl -n default exec pod/ci-runner -- \
# If the tests are successful, the cluster can be destroyed right away
rm "$PWD/destroy-cluster.txt"
fi
else
exit 1
fi
1 change: 1 addition & 0 deletions developer/openshift/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ main() {
"$PROJECT_DIR/developer/openshift/apps/$app.sh"
echo
done
check_CRDs
}

if [ "${BASH_SOURCE[0]}" == "$0" ]; then
Expand Down
19 changes: 19 additions & 0 deletions developer/openshift/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,26 @@ check_statefulsets() {
done
}

# Sometimes CRDs need a few seconds to be ready
check_CRDs() {
local retry=0
while true; do
if [ "$retry" -eq 5 ]; then
printf "Error: Tekton CRDs cannot be ready on the cluster.\n" >&2
exit 1
fi
tekton_crds=$(oc api-resources --api-group="tekton.dev" --no-headers)
if [[ $tekton_crds =~ pipelines && $tekton_crds =~ tasks && $tekton_crds =~ pipelineruns && $tekton_crds =~ taskruns ]]; then
break
fi
sleep 5
retry=$((retry + 1))
done
}

indent () {
offset="${1:-2}"
sed "s/^/$(printf "%${offset}s")/"
}


0 comments on commit 81454e7

Please sign in to comment.