Skip to content

fix(pipelines): add retry wrappers to network calls in image mirror script (AROSLSRE-1490) - #269

Open
trevorwilliams2025 wants to merge 2 commits into
Azure:mainfrom
trevorwilliams2025:fix/image-mirror-retry-wrappers
Open

fix(pipelines): add retry wrappers to network calls in image mirror script (AROSLSRE-1490)#269
trevorwilliams2025 wants to merge 2 commits into
Azure:mainfrom
trevorwilliams2025:fix/image-mirror-retry-wrappers

Conversation

@trevorwilliams2025

Copy link
Copy Markdown
Contributor

Summary

  • Wraps all bare network-touching az/oras/oc calls in on-demand.sh with the existing retry 5 helper (exponential backoff)
  • Deduplicates az cloud show into a shared top-level get_acr_domain_suffix() function used by both code paths
  • Fixes unquoted variables in the OCI-layout oras login call

Context

Ev2 step mirror-oc-mirror-image failed in uksouth (public/stg) during rollout d3208ea2-7650-4209-8e14-db081fba362d. The root cause was a transient IMDS/ARM connection reset (BadStatusLine HTTP/1.1 000) hitting az keyvault secret download — the only network call in that block without a retry wrapper. The az login --identity call hit the same error moments earlier but recovered because common.sh
wraps it with az_retry 15.

This is the same transient IMDS failure class addressed by:

  • AROSLSRE-1292common.sh added az_retry around az login --identity for BadStatusLine/IMDS resets
  • AROSLSRE-1228prow-job-executor added retry with exponential backoff around Key Vault prow-token lookup for IMDS connection resets/EOFs on Ev2 runners
  • PR fix: Add retry logic to ACR login in on-demand sync script #220on-demand.sh added retry 5 around az acr login for the same error class

This PR closes the gap by applying the same pattern to the remaining bare network calls in on-demand.sh.

Calls now wrapped with retry 5:

Call Path
az keyvault secret download Registry (direct cause of outage)
az cloud show Both (deduplicated to shared function)
oc registry login Registry (CI source auth)
oras login Both paths
oras cp Both paths

Jira: AROSLSRE-1490

Test plan

  • bash -n on-demand.sh — syntax validates
  • go test ./pipelines/types/... — existing tests pass
  • Verify on next rollout with DRY_RUN=true (exercises all auth/login paths)

…ror script (AROSLSRE-1490)

The on-demand sync script (on-demand.sh) had several network-touching
az/oras/oc calls without retry logic. A transient IMDS/ARM connection
reset (BadStatusLine HTTP/1.1 000) on az keyvault secret download
caused the mirror-oc-mirror-image Ev2 step to fail in uksouth (stg),
even though the retry helper and pattern already existed in the script.

Wrap all bare network calls with the existing retry helper:
- az keyvault secret download (direct cause of the outage)
- az cloud show (both registry and OCI layout paths, deduplicated)
- oc registry login
- oras login (both paths)
- oras cp (both paths)

Also fixes unquoted variables in the OCI-layout oras login call.
Copilot AI review requested due to automatic review settings July 15, 2026 02:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the resiliency of the pipelines/types/on-demand.sh image mirroring script by applying retry behavior to previously bare network-touching az/oc/oras calls, reducing transient IMDS/ARM-related rollout failures.

Changes:

  • Adds a shared get_acr_domain_suffix() helper and uses it from both registry and OCI-layout flows.
  • Wraps additional network-dependent commands (az keyvault secret download, oc registry login, oras login, oras cp) with the existing retry 5 helper.
  • Fixes quoting in the OCI-layout oras login invocation and cleans up minor formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pipelines/types/on-demand.sh
Comment thread pipelines/types/on-demand.sh
Copilot AI review requested due to automatic review settings July 15, 2026 02:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread pipelines/types/on-demand.sh
Copilot AI review requested due to automatic review settings July 15, 2026 02:51
@trevorwilliams2025
trevorwilliams2025 force-pushed the fix/image-mirror-retry-wrappers branch from eaef36f to 4e58828 Compare July 15, 2026 02:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread pipelines/types/on-demand.sh
@trevorwilliams2025 trevorwilliams2025 changed the title fix(pipelines): add retry wrappers to bare network calls in image mirror script (AROSLSRE-1490) fix(pipelines): add retry wrappers to network calls in image mirror script (AROSLSRE-1490) Jul 15, 2026

@raelga raelga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants