feat(controller): stamp controller-version provenance onto RunnerPools #41
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/runnerpool-version-provenance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Attach two annotations under the runners.forgejo.brooktrails.org/ namespace
to each reconciled RunnerPool to aid provenance and troubleshooting:
created-by is attributable only on a pool's first-ever reconcile, detected
via finalizer absence (a pool without our finalizer has never been managed by
any version of this operator). It is never backfilled onto a pre-existing
pool, since doing so would falsely claim the upgrading version created it;
such pools simply carry no created-by annotation, which reads as "created
before this tracking existed / by an unknown version".
modified-by is refreshed to the running controller's version whenever it
differs. The helper patches only when a value actually changes, so
steady-state reconciles by a same-version controller incur no extra writes,
and an upgrade refreshes modified-by on the first reconcile.
The build-time version (already injected via -ldflags into cmd/controller) is
wired into the reconciler. Annotations are freeform metadata, so no CRD or
generated-manifest changes are required.
Adds a table-driven test (first use of the controller-runtime fake client in
this package) covering first reconcile, the no-backfill case, version upgrade,
the no-write steady state, and the empty-version no-op. go mod tidy pulls in
one already-in-graph indirect dependency (json-patch.v4) used by the fake
client.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Automated review by pr-reviewer v0.29.1 | Safety Check | Mistral Small | tracking id
r-413531-a6baf8This is an AI-generated review and may contain mistakes.
Status: ❌ Failed
Review failed. Tracking id
r-413531-a6baf8— see logs for details.Comment
@pr-reviewer-bot retryto try again.