fix: retry observability oci chart fetches
This commit is contained in:
@@ -967,17 +967,24 @@ jobs:
|
||||
wait_for_ocirepository_ready_or_cached() {
|
||||
local repository="$1"
|
||||
local timeout="$2"
|
||||
local attempts="${3:-6}"
|
||||
local artifact_storage
|
||||
local attempt
|
||||
|
||||
if kubectl -n flux-system wait --for=condition=Ready "ocirepository/${repository}" --timeout="${timeout}"; then
|
||||
return 0
|
||||
fi
|
||||
for attempt in $(seq 1 "${attempts}"); do
|
||||
reconcile_flux_resource "ocirepository/${repository}" 300
|
||||
if kubectl -n flux-system wait --for=condition=Ready "ocirepository/${repository}" --timeout="${timeout}"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
artifact_storage="$(kubectl -n flux-system get "ocirepository/${repository}" -o jsonpath='{.status.conditions[?(@.type=="ArtifactInStorage")].status}' 2>/dev/null || true)"
|
||||
if [ "${artifact_storage}" = "True" ]; then
|
||||
echo "OCIRepository ${repository} is not currently Ready; continuing with cached artifact" >&2
|
||||
return 0
|
||||
fi
|
||||
artifact_storage="$(kubectl -n flux-system get "ocirepository/${repository}" -o jsonpath='{.status.conditions[?(@.type=="ArtifactInStorage")].status}' 2>/dev/null || true)"
|
||||
if [ "${artifact_storage}" = "True" ]; then
|
||||
echo "OCIRepository ${repository} is not currently Ready; continuing with cached artifact" >&2
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "OCIRepository ${repository} did not become Ready after ${timeout}; forcing retry (${attempt}/${attempts})" >&2
|
||||
done
|
||||
|
||||
observability_diagnostics
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user