feat: add parent-side MI pool allocator and env-var consumer for ARO-26725 #6635
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.57) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 568 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6635"
general
weight: 0.35
mgahagan73
ARO-26725
What
Groundwork for retiring the file-based identity container broker. Adds the parent-side MI pool allocator, container cleanup functions, and the child-side env-var consumer path — without changing any existing runtime behavior. The new code paths only activate when
ASSIGNED_MI_CONTAINERSis set by a future OTE integration (blocked on openshift-eng/openshift-tests-extension#79).miDemandPriority,ARO_HCP_DISABLE_MI_SORTkill switch, and associated tests; the ResourcePools scheduler enforces capacity/fairness (validated in ARO-26726)mipool.Pool(test/cmd/aro-hcp-tests/internal/mipool/pool.go) — thread-safe parent-side allocator withAllocate,Release, andReleaseWithCleanupmipool.CleanupContainer/CleanupAllContainers(cleanup.go) — standalone functions to sweep residual FICs and role assignments from containers at startup or after child exitidentities_helper.go—AssignIdentityContainersandgetLeasedIdentitiescheckASSIGNED_MI_CONTAINERSfirst; when unset (current state), the existing file-based path runs unchangedWhy
ARO-26725 replaces the file-based identity container broker with parent-side allocation via environment variable injection. The file-based broker has three known bugs (release-before-cleanup, lock held during API calls, no stale entry recovery) that the new design eliminates by construction. This PR lands the pieces that can proceed without the OTE dependency, keeping the branch small and reviewable while unblocking future integration work.
Testing
-
mipool/pool_test.go— 19 tests covering New, Allocate, Release, ReleaseWithCleanup, FormatEnv, AllContainers, concurrent access (with-race)-
identities_helper_test.go— 7 new tests for the env-var consumer path (TestAssignFromEnv, TestLeaseFromEnv, TestAssignFromEnvThenLeaseFromEnv)ASSIGNED_MI_CONTAINERSis set by a future PR (5f), so there is nothing to exercise end-to-end yet.What the pre-merge CI jobs will verify:
e2e-paralleland other E2E jobs confirm no regressions from the sort removal and the new env-var branch inidentities_helper.go. BecauseASSIGNED_MI_CONTAINERSis never set in CI,AssignIdentityContainersevaluates the env var as empty, skips the new path, and falls through to the existing file-based code. Every E2E test follows exactly the same runtime path as onmain.make lint/make test/make verifyconfirm the new code compiles, passes lint, and the unit test suite is green.What the pre-merge CI jobs will NOT verify:
mipool.Poolallocator is not imported bymain.go— it is an unwired library. No CI job exercises it at runtime.assignFromEnv,leaseFromEnv) is unreachable because nothing setsASSIGNED_MI_CONTAINERS. It is covered only by unit tests.CleanupContainer/CleanupAllContainersrequire live Azure clients and are not called from any entrypoint. The startup sweep and post-child cleanup will be wired in sub-task 5f after OTE PR #79 merges.Special notes for your reviewer
The
mipoolpackage is intentionally unwired frommain.go. It will be connected viaAddBeforeSpawnin a follow-up PR once OTE PR #79 merges and provides theEnvfield +SpawnProcessToRunTestWithEnvhook. At that point the file-based broker code can be deleted (sub-task 5h).PR Checklist
🤖 Generated with Claude Code