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() { wait_for_ocirepository_ready_or_cached() {
local repository="$1" local repository="$1"
local timeout="$2" local timeout="$2"
local attempts="${3:-6}"
local artifact_storage local artifact_storage
local attempt
if kubectl -n flux-system wait --for=condition=Ready "ocirepository/${repository}" --timeout="${timeout}"; then for attempt in $(seq 1 "${attempts}"); do
return 0 reconcile_flux_resource "ocirepository/${repository}" 300
fi 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)" 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 if [ "${artifact_storage}" = "True" ]; then
echo "OCIRepository ${repository} is not currently Ready; continuing with cached artifact" >&2 echo "OCIRepository ${repository} is not currently Ready; continuing with cached artifact" >&2
return 0 return 0
fi fi
echo "OCIRepository ${repository} did not become Ready after ${timeout}; forcing retry (${attempt}/${attempts})" >&2
done
observability_diagnostics observability_diagnostics
exit 1 exit 1
@@ -5,6 +5,7 @@ metadata:
namespace: flux-system namespace: flux-system
spec: spec:
interval: 10m interval: 10m
timeout: 5m
url: oci://ghcr.io/grafana/helm-charts/loki url: oci://ghcr.io/grafana/helm-charts/loki
ref: ref:
tag: 6.46.0 tag: 6.46.0
@@ -5,6 +5,7 @@ metadata:
namespace: flux-system namespace: flux-system
spec: spec:
interval: 10m interval: 10m
timeout: 5m
url: oci://ghcr.io/grafana/helm-charts/promtail url: oci://ghcr.io/grafana/helm-charts/promtail
ref: ref:
tag: 6.16.6 tag: 6.16.6