diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 5f70379..8d03e12 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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 diff --git a/infrastructure/addons/observability/ocirepository-loki.yaml b/infrastructure/addons/observability/ocirepository-loki.yaml index 6a9bd98..96e7b2e 100644 --- a/infrastructure/addons/observability/ocirepository-loki.yaml +++ b/infrastructure/addons/observability/ocirepository-loki.yaml @@ -5,6 +5,7 @@ metadata: namespace: flux-system spec: interval: 10m + timeout: 5m url: oci://ghcr.io/grafana/helm-charts/loki ref: tag: 6.46.0 diff --git a/infrastructure/addons/observability/ocirepository-promtail.yaml b/infrastructure/addons/observability/ocirepository-promtail.yaml index 064100c..1fb35f6 100644 --- a/infrastructure/addons/observability/ocirepository-promtail.yaml +++ b/infrastructure/addons/observability/ocirepository-promtail.yaml @@ -5,6 +5,7 @@ metadata: namespace: flux-system spec: interval: 10m + timeout: 5m url: oci://ghcr.io/grafana/helm-charts/promtail ref: tag: 6.16.6