You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "CSR Attempt $i of $csr_max_retries: Checking for pending CSRs..."
139
+
if ! oc get csr 2>/dev/null | grep -i Pending; then
140
+
echo "No pending CSRs found. Continuing"
141
+
approved_csrs=true
142
+
break
143
+
else
144
+
echo "There are pending CSRs. That probably means cluster was hibernated for more than 24 hours. Need to approve them (until OCPBUGS-55339 is resolved)"
145
+
if oc get csr -oname | xargs oc adm certificate approve; then
146
+
echo "Successfully submitted approval for CSRs on attempt $i."
147
+
sleep 2 # Small delay for changes to propagate
148
+
if ! oc get csr 2>/dev/null | grep -i Pending; then
149
+
echo "Confirmed no pending CSRs after approval."
150
+
approved_csrs=true
151
+
break
152
+
else
153
+
echo "Pending CSRs still exist after approval attempt $i."
154
+
fi
155
+
else
156
+
echo "Failed to run approval command for CSRs on attempt $i."
157
+
fi
158
+
fi
159
+
160
+
if [[ "$i" -lt "$csr_max_retries" ]]; then
161
+
echo "Sleeping for $csr_sleep_duration seconds before next CSR retry..."
162
+
sleep "$csr_sleep_duration"
163
+
fi
164
+
done
165
+
166
+
if [[ "$approved_csrs" == "true" ]]; then
167
+
echo "CSR check and approval process completed successfully."
168
+
else
169
+
echo "Failed to ensure all pending CSRs were approved after $csr_max_retries attempts."
0 commit comments