fix: retry observability oci chart fetches
Deploy Cluster / Terraform (push) Successful in 32s
Deploy Cluster / Ansible (push) Successful in 18m20s

This commit is contained in:
2026-05-03 07:24:31 +00:00
parent 4197647b08
commit e5c8d55530
3 changed files with 17 additions and 8 deletions
+15 -8
View File
@@ -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