fix(operator): resolve the post-merge review of the operator #3501
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3501"
general
weight: 0.35
yuanchen8911
Summary
Fixes the AICR Operator issues raised in the post-merge review of #3475: rollout and approval edge cases, unbounded or overflowing readers, admission gaps, metrics, and controller setup. Each fix has a regression test.
Motivation / Context
#3475 was reviewed after it merged. This PR fixes the verified findings before the operator ships as a preview (#3469). Docs-only findings are fixed in #3491. Findings that need more than a small change are tracked in #3495–#3499, #3502 and #3514. Each review thread says which applies.
Fixes: N/A
Related: #3469
Related: #3514
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)pkg/operator,api/operator,cmd/aicr-operator,charts/aicr-operator,tests/operator)Implementation Notes
The commits are grouped by area.
Chart, controller setup and metrics (c7f24211e):
approvalRequired: falseor an outcome label skipped approval, held back only by RBAC.HOME,TMPDIRandDOCKER_CONFIGby value, with noenvFrom, and mount only emptyDir and Secret volumes. An env var such asAICR_IMAGEcan therefore no longer get around the pinned image.GOMEMLIMITfollows the memory limit, the grace period is 45s, and the operator refuses to start when validation is enabled butPOD_NAMEis unset.aicr_operator_job_*. Nothing has shipped yet, so the rename is free.ecr:CreateRepositoryunder the prefix.Engine, registry, resolver and Jobs (f0715f225):
templates/values.yamlcounts.orphaned-fromwrite is reported as an Event and no longer holds the finalizer.0until known.Rollout, approval and validation (573286573):
--expiresis set; the old 2-hour default could end a rollout half-applied.CurrentStep.Attempts, always 1, is removed, and the CRD is regenerated.Integration (0eba4844a): refuses a chart-fetch redirect to an unconfigured plain-HTTP host, and documents the new Event and the tightened policies.
Pre-PR review (cd9dbfda6). A review of the combined change found one gap that predates this branch, and four smaller ones:
--imageand--image=. The CLI also parses-image,-image=, and--config, whose file can name the agent image, so a Job could run another image in the privileged discovery namespace. Now only the exact--image <pinned>pair may name an image, and no Job takes--config.Unauthorizedinstead of leaving its status frozen.CheckRedirect.Later review comments (ddbdfaf78):
Behavior changes worth knowing:
RegistryCredentialsStale.Testing
make qualifypasses, with 85.8% coverage, andmake operator-check-generatedreports the generated code current. Both ran on the branch before its rebase onto #3491; they run again on this head before it leaves draft.Risk Assessment
It tightens admission and changes rollout gating in several places. The operator has not shipped, so no installed state depends on the old behavior.
Rollout notes: The CRD change only removes an unused status field. A chart upgrade applies the new policies.
Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info