Skip to content

test: fix shared-RG E2E for atm/afd and use the dedicated WIF connection - #461

Merged
Wei Weng (weng271190436) merged 2 commits into
ci/shared-e2e-resource-groupfrom
xuxife/26/11/25/fix-shared-e2e-atm-afd
Nov 25, 2026
Merged

Wei Weng (weng271190436) merged 2 commits into
ci/shared-e2e-resource-groupfrom
xuxife/26/11/25/fix-shared-e2e-atm-afd

Conversation

@xuxife

@xuxife xuxife commented Nov 25, 2026

Copy link
Copy Markdown

Follow-up to #460 that fixes the two scenarios that failed in pipeline run 193063376 and moves the pipeline to the dedicated least-privilege WIF identity.

afd: The short SHA 6124884 contained only digits. bootstrap.sh passed it with --set image.tag=$TAG, and the later helm upgrade --reuse-values in install-afd.sh re-rendered it as 6.124884e+06. The pods then failed with InvalidImageName and helm timed out. All image tags are now passed with --set-string.

atm: traffic_manager_test.go updates Traffic Manager endpoints directly. With Contributor scoped to the shared resource group, the call returns LinkedAuthorizationFailed, because the caller must be able to join the endpoint public IPs in the members' MC_* groups. Setup now grants E2E_TEST_PRINCIPAL_ID Network Contributor on both member node resource groups. The conditional subscription-scoped RBAC Administrator role already permits that grant, and the assignment is removed when the node resource group is deleted.

pipeline: E2E_TEST_PRINCIPAL_ID is now derived from the signed-in token's oid by test/scripts/caller-object-id.sh, so it always matches the service connection that actually runs the job. The default service connection is now aks-devinfra-fleet-networking-e2e-wif, a Corp UAMI with WIF managed in aks-rp devinfraservices/ci-resources. That connection has a Branch control check that allows only protected main, so validation runs from other branches must override serviceConnection to aks fleetnetworking, whose service principal has the same least-privilege grants.

Testing: go test ./test/scripts ./test/e2e/framework, bash -n on every script, and shellcheck (no new warnings). An ADO validation run on this branch is linked in the comments.

Xingfei Xu and others added 2 commits November 25, 2026 00:53
A short commit SHA made only of digits, such as 6124884, is parsed by helm
as a number and rendered as 6.124884e+06 after helm upgrade --reuse-values,
which breaks the image reference (InvalidImageName).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
traffic_manager_test.go updates Traffic Manager endpoints directly, which
requires joining the members' public IPs in their node resource groups.
With least-privilege Contributor scoped to the shared resource group this
returned LinkedAuthorizationFailed, so setup now grants E2E_TEST_PRINCIPAL_ID
Network Contributor on both member node resource groups.

The pipeline derives E2E_TEST_PRINCIPAL_ID from the signed-in token so it
always matches the service connection in use, and defaults to the dedicated
aks-devinfra-fleet-networking-e2e-wif connection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@weng271190436
Wei Weng (weng271190436) merged commit 1ebace1 into ci/shared-e2e-resource-group Nov 25, 2026
13 checks passed
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