Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,31 @@ else
exit 1
fi

timeout --foreground 5m bash <<-"EOF"
# Disable tracing to protect credentials from leaking into CI logs
set +x 2>/dev/null
Copy link
Contributor

@zdrapela zdrapela Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use set anywhere in the CI scripts, so the set +x is present by default. If you want to configure it explicitly, it makes sense to do it at the beginning of the commands.sh bash script? Because this is not the only sensitive data here.

if ! timeout --foreground 10m bash <<-"EOF"; then
while ! oc login "$OPENSHIFT_API" -u "$OPENSHIFT_USERNAME" -p "$OPENSHIFT_PASSWORD" --insecure-skip-tls-verify=true; do
sleep 20
echo "Login failed, retrying in 30s..."
sleep 30
done
EOF
if [ $? -ne 0 ]; then
echo "Timed out waiting for login"
exit 1
fi

echo "========== Cluster Health Check =========="
echo "Verifying cluster API server is fully responsive..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a check for nodes to be ready, so why not echo what it actually is?
Maybe also oc wait --for=condition=Ready nodes --all --timeout=XXXs may be handy here?

if ! timeout --foreground 5m bash <<-"EOF"; then
while ! oc get nodes 2>&1; do
echo "API server not ready, retrying in 15s..."
sleep 15
done
EOF
echo "Timed out waiting for cluster API server to become ready"
exit 1
fi
echo "Cluster API server is ready"

echo "========== Cluster Service Account and Token Management =========="
export K8S_CLUSTER_URL K8S_CLUSTER_TOKEN
K8S_CLUSTER_URL=$(oc whoami --show-server)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,31 @@ else
exit 1
fi

timeout --foreground 5m bash <<-"EOF"
# Disable tracing to protect credentials from leaking into CI logs
set +x 2>/dev/null
if ! timeout --foreground 10m bash <<-"EOF"; then
while ! oc login "$OPENSHIFT_API" -u "$OPENSHIFT_USERNAME" -p "$OPENSHIFT_PASSWORD" --insecure-skip-tls-verify=true; do
sleep 20
echo "Login failed, retrying in 30s..."
sleep 30
done
EOF
if [ $? -ne 0 ]; then
echo "Timed out waiting for login"
exit 1
fi

echo "========== Cluster Health Check =========="
echo "Verifying cluster API server is fully responsive..."
if ! timeout --foreground 5m bash <<-"EOF"; then
while ! oc get nodes 2>&1; do
echo "API server not ready, retrying in 15s..."
sleep 15
done
EOF
echo "Timed out waiting for cluster API server to become ready"
exit 1
fi
echo "Cluster API server is ready"

echo "========== Cluster Service Account and Token Management =========="
export K8S_CLUSTER_URL K8S_CLUSTER_TOKEN
K8S_CLUSTER_URL=$(oc whoami --show-server)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,31 @@ else
exit 1
fi

timeout --foreground 5m bash <<-"EOF"
# Disable tracing to protect credentials from leaking into CI logs
set +x 2>/dev/null
if ! timeout --foreground 10m bash <<-"EOF"; then
while ! oc login "$OPENSHIFT_API" -u "$OPENSHIFT_USERNAME" -p "$OPENSHIFT_PASSWORD" --insecure-skip-tls-verify=true; do
sleep 20
echo "Login failed, retrying in 30s..."
sleep 30
done
EOF
if [ $? -ne 0 ]; then
echo "Timed out waiting for login"
exit 1
fi

echo "========== Cluster Health Check =========="
echo "Verifying cluster API server is fully responsive..."
if ! timeout --foreground 5m bash <<-"EOF"; then
while ! oc get nodes 2>&1; do
echo "API server not ready, retrying in 15s..."
sleep 15
done
EOF
echo "Timed out waiting for cluster API server to become ready"
exit 1
fi
echo "Cluster API server is ready"

echo "========== Cluster Service Account and Token Management =========="
export K8S_CLUSTER_URL K8S_CLUSTER_TOKEN
K8S_CLUSTER_URL=$(oc whoami --show-server)
Expand Down