From 992371e6cd4b7c4b5916b3a90d0a922170ed8042 Mon Sep 17 00:00:00 2001 From: Ilya Kogan Date: Thu, 14 May 2026 10:58:03 -0400 Subject: [PATCH 1/2] Don't die if you can't reach a single Rancher server. --- adp-connect.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adp-connect.sh b/adp-connect.sh index 8e93ded..62c1945 100755 --- a/adp-connect.sh +++ b/adp-connect.sh @@ -773,6 +773,13 @@ if [[ ! "${ONLY_DOWNLOAD}" = "true" ]]; then for SERVER in $(yq -r '.Servers | to_entries[] | .key' < "$HOME/.rancher/cli2.json" | grep -v rancherDefault); do rancher server switch "${SERVER}" 2> >(grep -v "Saving config" >&2) >/dev/null + curl -s --max-time 10 "https://${SERVER}/ping" > /dev/null 2>&1 + CURL_EXIT=$? + if [[ $CURL_EXIT -eq 6 ]] || [[ $CURL_EXIT -eq 7 ]]; then + warn "⚠️ Warning: Unable to reach Rancher server ${SERVER} (host unreachable). Skipping." + continue + fi + if ! gum spin --show-error --title="Checking ${SERVER}..." rancher project list; then yq -i '.Servers["'"${SERVER}"'"].project = ""' "$HOME/.rancher/cli2.json" rancher_login "${SERVER}" From 7143ada8c45d12bcdcece7734bfb835463ed09bb Mon Sep 17 00:00:00 2001 From: Ilya Kogan <1840337+ikogan@users.noreply.github.com> Date: Thu, 14 May 2026 11:08:27 -0400 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- adp-connect.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adp-connect.sh b/adp-connect.sh index 62c1945..7310c75 100755 --- a/adp-connect.sh +++ b/adp-connect.sh @@ -773,10 +773,10 @@ if [[ ! "${ONLY_DOWNLOAD}" = "true" ]]; then for SERVER in $(yq -r '.Servers | to_entries[] | .key' < "$HOME/.rancher/cli2.json" | grep -v rancherDefault); do rancher server switch "${SERVER}" 2> >(grep -v "Saving config" >&2) >/dev/null - curl -s --max-time 10 "https://${SERVER}/ping" > /dev/null 2>&1 + curl -s --connect-timeout 5 --max-time 10 "https://${SERVER}/ping" > /dev/null 2>&1 CURL_EXIT=$? - if [[ $CURL_EXIT -eq 6 ]] || [[ $CURL_EXIT -eq 7 ]]; then - warn "⚠️ Warning: Unable to reach Rancher server ${SERVER} (host unreachable). Skipping." + if [[ $CURL_EXIT -eq 6 ]] || [[ $CURL_EXIT -eq 7 ]] || [[ $CURL_EXIT -eq 28 ]] || [[ $CURL_EXIT -eq 35 ]]; then + warn "⚠️ Warning: Unable to reach Rancher server ${SERVER} (connection, timeout, or TLS error). Skipping." continue fi