Repository navigation
feat(organization): reconcile the agent chart source on every reconcile - #74
Conversation
The organization's agent chart OCIRepository was created once and never updated, so a changed agent chart URL, semver range or filter never reached existing organizations: new agents there installed the old chart. Every reconcile now brings spec.url, spec.interval and spec.ref back to the configured chart source, keeping every other field and label, and writes nothing when they already match. An object of that name the operator did not write is still left alone. The operator's ClusterRole gets update on ocirepositories.
Published Helm chart
|
| Chart | agent-platform-operator |
| Version | 0.5.1-r27740a5ft20261130184326h0d7ad5e |
| OCI reference | oci://gsoci.azurecr.io/charts/giantswarm/agent-platform-operator:0.5.1-r27740a5ft20261130184326h0d7ad5e |
| Digest | sha256:d260a9244f2c7b21b73527c814a50ae7e5f3f21935a9ee261532f156cd061d17 |
| Registry | public — gsoci.azurecr.io |
| Git catalog | giantswarm-test-catalog (index) |
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent-platform-operator --version 0.5.1-r27740a5ft20261130184326h0d7ad5ePosted by architect-orb · build 1589 · commit 0d7ad5e · updated in place on every push
…ntil migrate marks it ready, and scope source updates to the chart's name A move of an existing organization's agent chart OCIRepository to a higher major now waits per organization for agent-manager's migrate: until its report ConfigMap there (agentChart.migrationReport) carries agent-platform.giantswarm.io/agent-chart-ready-major with the new major, the source keeps its ref while url and interval follow, the organization is not Ready (ChartSourceHeld) and is reconciled again every agentChart.migrationPoll. An organization with no HelmRelease on the source moves at once. Ranges are read as migrate and the platform chart read them, every alternative of a || range included. The ClusterRole updates OCIRepositories only by the chart's name and reads migrate's report ConfigMap only. A write the API server stores nothing of is logged at V(1), not as an update.
…f no or several majors A missing chart source whose namespace has a HelmRelease that last deployed a lower major is created only once agent-manager's migrate marks the namespace ready, as a move of the source would wait. A configured range that admits no release version (a pre-release pin) or several majors (>=2.6.0) creates and moves no source and sets Ready=False with reason ChartRangeInvalid instead of waiting for a mark migrate never writes. The mark must also name every HelmRelease on the source (agent-platform.giantswarm.io/agent-chart-ready-releases): a release created after migrate's run holds the move, and the condition says to run migrate again.
…ries the range An invalid range (several majors or none) was reported only when the chart source was missing or its ref differed. A source that already carried it (>=2.6.0) stayed Ready and Flux would move it to a major migrate never marked. Also pin the ref that names no major and the newest-first history order.
Review recordPart of giantswarm/giantswarm#38902 (tool approval, milestone 3, found in the milestone 2 lab run). Purpose: this record says what was reviewed on this branch (the chart source reconcile and its gate on a new major), by whom and with which outcome, so that reviewers can skip what is covered. Branch Read this first
Review rounds
What was checked
Design points (the gate was reviewed in rounds 5 to 11; the rest is from the implementer's notes)
Findings
Residuals of D-GO-03: between migrate's write and the operator's move (until the operator runs with the new range, then its poll) a rewritten release's 2.x upgrade fails and keeps its asking revision; a release created on the 2.x source after migrate's run holds the move and Lab verificationNot run with this commit. Lab run 2 found the defect; lab run 3 ran the released operator (0.4.7), whose organization source kept its creation URL and its old semver, so agents in the organization namespace stayed on the 2.x chart. The fix was not deployed in the lab. Open itemsFindings still open or partly fixed:
Never run:
|
Review record — updatePart of giantswarm/giantswarm#38902. Covers only what is new since the record above (tip Read this first
Open itemsNone new. Findings left open in the record above stand. |
# Conflicts: # internal/controller/organization.go
Review supplement for giantswarm/giantswarm#38902Reviewed head: SpecThe source now follows operator configuration and holds major upgrades pending migration. The ordinary hold/move contract is represented; the name-only readiness residual below deserves follow-up. This is a scoped contract assessment, not an exhaustive numbered acceptance score. Independent focused specification cross-checks covered the core enforcement/client contracts and platform/manager integration. Declared follow-ups and accepted design changes are not counted as new defects. BlockingNo new blocking code finding established in this pass. Non-blocking
SuggestionsNone beyond the existing review follow-ups. Deep verification
Reported checks passed or were skipped; no failed/cancelled check to triage. A skipped job is not evidence that its gate ran. Unverified locally: applicable builds, tests (including race/integration/envtest), vet, formatting/lint/pre-commit, generators, Makefile verification targets, Helm rendering/schema/unit checks, and browser/live-cluster flows. No PR code was executed. GitHub-reported CI provides supporting evidence, not a local reproduction. Recommendation: merge as-is within this review's scope, subject to existing release-order/rollout prerequisites and previously documented open items. This is not sign-off on production cutover: actual compatible release pins and the documented organization/remote-target rollout evidence remain required. Team context: none. |
Cross-repository reuse and simplicity follow-upReviewed Non-blocking: give the three chart-major classifiers one explicit contract. The Go classifiers in agent-manager and operator, and the Helm helper, duplicate finite-probe range classification with different limits. For The chart-source reconciler has a reasonable boundary; a new migration orchestration framework is not needed. The earlier stale readiness finding is the more immediate domain-model issue: the readiness record identifies release names but not the UID/values generation that migration actually inspected. Strengthening that record and sharing classifier contract tests would address concrete drift without a broad rewrite. No OAuth/MCP/A2A wire protocol is implemented by these operator changes; their responsibility is preserving the policy rollout preconditions. Verification: static source and published-spec review only; no PR code executed. Local builds, tests/race tests, lint, Helm gates, browser flows and independent-client interoperability remain unverified. Heads were rechecked unchanged. This supplements the earlier deep-review verdict and does not clear its blockers. |
Document the range grammar the chart-major classifier reads and refuse a range that admits a chart major of 100 or more as unsupported, as agent-manager's migrate and the agent-platform chart do.
…rded A HelmRelease recreated under the same name or whose spec changed after agent-manager's migrate run now holds the organization's chart source move, with a ChartSourceHeld condition naming it, until migrate runs again. A mark without the release versions holds too.
Review record — Quentin's reviewPart of giantswarm/giantswarm#38902. Answers the review of 2026-11-27 (comments below). Branch
Independent re-checkClaude Fable, 2026-11-28, detached worktree at
Open items
|
|
@QuentinBisson thanks for the thorough review (your comment). Addressed: QB-05 fixed in Details and the independent re-check are in the review record. |
# Conflicts: # go.mod
Review record — merge roundPart of giantswarm/giantswarm#38902. Reviewer: Claude Fable 5.2, independent of the implementing and merging model, read-only, verdicts formed from the code. Full review: Covers the merge of main
Run: |
Part of giantswarm/giantswarm#38902.
What does this PR do?
An organization's agent chart
OCIRepositorywas created once and never updated, so a changed agent chart URL, semver range or filter never reached existing organizations: new agents there installed the old chart. The agent chart's 3.x line (tool approval, linked below) needs every organization to follow the configured source.Every reconcile now brings
spec.url,spec.intervalandspec.refback to the configured chart source. It keeps every other field and label (for exampleinsecure, a certificate secret) and writes nothing when the owned fields already match. An object of that name the operator did not write (noorganization-objectlabel) is still left alone. The operator's ClusterRole getsupdateonocirepositories(wasget, create), limited byresourceNamesto the chart's name (the last segment ofagentChart.ociUrl), andgeton the migrate report ConfigMap only.spec.refis owned as a whole map: Flux resolvesdigestoversemverovertag, so a straytagordigestleft beside the range would pin or shadow it.HelmReleaseon the source. Until then the ref stays, url and interval follow, and the organization isReady=False(ChartSourceHeld). A range of no or several majors creates and moves no source (ChartRangeInvalid). The operator is the only writer of the copy, so migrate cannot move it itself.values.yamland schema, the helm README (agentChart.ociUrl).Since the first review record: a merge of
main(the AWS SDK update only), a test-only CI fix (each envtest starts its own manager) and condensed docs and values comments; no change to the reconcile or the gate. Tip86f31d0; the update comment in the review record says the same. Review round of 2026-11-27 (Quentin):ad0943c,754e612and a merge ofmain; tip754e612; see the comment "Review record — Quentin's review".What is the effect of this change to users?
Organizations follow the operator's configured agent chart source: a changed URL or range within a major reaches existing organizations on the next reconcile, and a higher major reaches an organization once migrate has marked it ready. The operator needs the added RBAC; the chart renders it.
What does it look like?
No visual change.
Changes from the plan
Where this PR differs from the design in the epic (giantswarm/giantswarm#38902):
Ready=False(ChartSourceHeld, requeued everyagentChart.migrationPoll, 1m default). A range of no or several majors creates and moves no source (ChartRangeInvalid), also where a source already carries it; a recreated source waits for the mark when a release on it last deployed a lower major. The design had the source follow a major at once; that left every organization release still carryingmuster.requireApprovalfailing chart 3.0's schema.ChartSourceHeldnaming the releases, and a mark without versions holds. A release recreated or edited after the report no longer passes on its name alone.Any background context you can provide?
Epic giantswarm/giantswarm#38902. Found in the M2 lab (2026-11-26): the organization source kept its creation URL and its range did not move with the 3.x line, so an organization's agents stayed on the 2.x chart and agent-manager chose
toolsetovertoolsfor them. The M3 lab saw it again.What is needed from the reviewers?
ChartSourceHeldandChartRangeInvalidare the right signals.updateonocirepositoriesbyresourceNames,geton the migrate report ConfigMap).Do the docs need to be updated?
Done in this PR (README, values comment and schema, helm README).
Testing
internal/controller/chartsource_test.go): create, move keeping fields and labels, a defaulted spec not rewritten, a foreign object untouched,semverFilterset and removed.golangci-lintv2.14.0 run viago run(the locally installed version cannot typecheck under the Go toolchain used).TestChartRangeInvalidEnvtest(its own API server,>=2.6.0), envtest as the rendered RBAC (updating another OCIRepository and reading another ConfigMap are Forbidden). A second model reviewed the change in four passes (delta review, re-check, final re-check, last review) with 38 mutants; no open finding above minor.Review round 2026-11-28 (
ad0943c,754e612): unit tests and envtest for the version-bound gate and the range limit;internal/controllerpasses in the independent re-check (envtest not run there).Related pull requests