Skip to content

Commit

Permalink
Print debug log for OCP deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
xinredhat authored and Roming22 committed Aug 17, 2023
1 parent ce1c9a9 commit 3012fa0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .tekton/pipeline/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec:
when:
- input: "$(tasks.deploy-cluster.status)"
operator: notin
values: ["None"]
values: ["None", "Failed"]
params:
- name: cluster-name
value: "$(tasks.generate-cluster-name.results.cluster-name)"
Expand Down
2 changes: 1 addition & 1 deletion .tekton/pipeline/upgrade-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ spec:
when:
- input: "$(tasks.deploy-cluster.status)"
operator: notin
values: ["None"]
values: ["None", "Failed"]
params:
- name: cluster-name
value: "$(tasks.generate-cluster-name.results.cluster-name)"
Expand Down
10 changes: 7 additions & 3 deletions ci/images/ci-runner/hack/bin/deploy-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source "$SCRIPT_DIR/utils.sh"

print_debug_info() {
printf "Print debug info......\n" | indent 2
rosa describe cluster --cluster="$CLUSTER_NAME"
rosa --region "$REGION" describe cluster --cluster="$CLUSTER_NAME"
}

# Check all of clusteroperators are AVAILABLE
Expand All @@ -23,7 +23,7 @@ check_clusteroperators() {
for operator in $operators; do
# need to check if the operator is available or not in a loop
retries=0
max_retries=10
max_retries=25
# if the operator is not available, wait 60s and check again
while [ "$retries" -lt "$max_retries" ]; do
available=$(kubectl get co "$operator" -o jsonpath='{.status.conditions[?(@.type=="Available")].status}')
Expand All @@ -37,6 +37,10 @@ check_clusteroperators() {
# if the operator is still not available after 10 times, exit 1
if [ "$retries" -eq "$max_retries" ]; then
echo "Operator $operator is not available" >&2
# print the status of all cluster operators
kubectl get co
# print the status of the failed cluster operator
kubectl get co "$operator" -o yaml
exit 1
fi
done
Expand Down Expand Up @@ -70,7 +74,7 @@ deploy_cluster() {
api_url="$(echo "$admin_output" | grep -oP '(?<=oc login ).*(?= --username)')"

# Use the admin account to login to the cluster in a loop until the account is active.
max_retries=5
max_retries=10
retries=0
export KUBECONFIG="$KUBECONFIG_DIR/kubeconfig"
while ! oc login "$api_url" --username "$admin_user" --password "$admin_pass" > /dev/null 2>&1; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ run_task() {
for BINARY in "${BINARIES[@]}"; do
update_binary
done
if [ $(git diff shared/config/dependencies.sh | wc -l) != "0" ]; then
if [ "$(git diff shared/config/dependencies.sh | wc -l)" != "0" ]; then
git diff shared/config/dependencies.sh \
| grep "^+export" \
| sed -e "s:^+export:-:" -e "s:_VERSION=: to :" \
Expand Down
2 changes: 1 addition & 1 deletion developer/images/dependencies-update/hack/bin/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ prepare_branch(){

show_summary(){
local updated="false"
if ! git diff --quiet $START_COMMIT..HEAD; then
if ! git diff --quiet "$START_COMMIT"..HEAD; then
updated="true"
fi

Expand Down

0 comments on commit 3012fa0

Please sign in to comment.