Skip to content

fix(ci): pin shared gallery lookup API - #936

Closed
Kevin Cho (chokevin) wants to merge 2 commits into
mainfrom
chokevin-shared-gallery-api-fix
Closed

Kevin Cho (chokevin) wants to merge 2 commits into
mainfrom
chokevin-shared-gallery-api-fix

Conversation

@chokevin

Copy link
Copy Markdown
Contributor

Azure Container Linux host-image resolution started failing before VM provisioning because Azure CLI's az sig image-version show-shared selected unsupported Microsoft.Compute API version 2026-03-03 for locations/sharedGalleries in westus2. The harness now resolves latest through the same ARM resource with az rest pinned to supported API version 2024-03-03, while preserving the existing optional ACL_IMAGE_SUBSCRIPTION forwarding.

This is a compatibility workaround for deterministic Azure CLI drift tracked in Azure/azure-cli#34229; upstream is reverting the regression in Azure/azure-cli#34232.

  • Uses az account show to resolve the effective subscription, then URL-encodes each shared-gallery path component and requests the exact Microsoft.Compute/locations/sharedGalleries/.../versions/latest?api-version=2024-03-03 resource.
  • Keeps both Azure commands behind the existing acl_az builder, so ACL_IMAGE_SUBSCRIPTION is forwarded consistently.
  • Removes the failing show-shared lookup only from Azure Container Linux gallery-version resolution.
  • Adds focused assertions for the account lookup, exact REST URL/API version, subscription forwarding, and absence of show-shared.

Evidence

Verification

  • Passed: cd hack/agent/e2e-kind && python3 -m unittest -v test_host_image.py (43 tests)
  • Passed: COPYFILE_DISABLE=1 TMPDIR="$PWD/tmp/python-tests" python3 -m unittest discover -s hack/agent/e2e-kind -p 'test_*.py' (111 tests)
  • Passed: python3 -m py_compile hack/agent/e2e-kind/e2e.py hack/agent/e2e-kind/test_host_image.py
  • Passed: git diff --check

Risk

The change is limited to CI host-image discovery. The primary risk is future ARM API retirement or a shared-gallery resource-shape change; the focused command/URL tests detect accidental drift, and reverting this commit restores the Azure CLI command once the upstream fix is available.

Non-goals

AI assistance: Used GitHub Copilot to help implement the isolated workaround, run validation, and draft this description; the author verified the diff, commands, links, and final text.

@chokevin
Kevin Cho (chokevin) requested a review from a team October 16, 2026 07:58
@chokevin

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

…ry-api-fix

# Conflicts:
#	hack/agent/e2e-kind/e2e.py
#	hack/agent/e2e-kind/test_host_image.py

Co-authored-by: chokevin <11001563+chokevin@users.noreply.github.com>

Copilot AI commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Resolved the conflicts and merged main in commit f19b5ff. The host-image tests pass.

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.

2 participants