Add controller-reference subject owner adapter - #1557
Open
nadaverell wants to merge 3 commits into
Open
nadaverell wants to merge 3 commits into
nadaverell wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit be830d5. Configure here.
This was referenced Aug 31, 2026
Use resourceid.GroupFromAPIVersion after the identity centralization, reject a known-namespaced controller owner of a cluster-scoped child, and treat only the core-group Node as the static-pod terminal.
nadaverell
force-pushed
the
nadav/rad-418-subject-parent-parity
branch
from
September 29, 2026 23:53
d7bdf26 to
35754e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Status and program context
Ready for review as an independent foundation. No production consumer uses this resolver yet.
The GPU, batch, and AI/ML breadth work exposed a shared prerequisite: Radar cannot compose controller-generated resources across Topology, Applications, Issues, Timeline, and MCP while owner identity is only Kind + namespace + name. This PR is the P0.1c subject-parity foundation for resolving Kubernetes controller ownership with exact API-group identity. Controller-native contexts and drilldowns such as JobSet are separate verticals.
Summary
ControllerOwnerResolverover injected exact-resource lookup and exact group/kind scope resolutionDependency and merge map
mainand is independently mergeable.main. Everything this PR referenced has since merged (#1558, #1559, #1560, the JobSet stack), along with #1868, which moved identity helpers intopkg/resourceid. The resolver now usesresourceid.GroupFromAPIVersion.Review focus
Deliberate boundaries
This PR does not switch a production consumer, expand operator allowlists, follow broad topology management edges, or aggregate root-level Issues. The Strimzi fixture intentionally stops at
StrimziPodSet: current Strimzi creates the KafkaNodePool reference withcontroller=false, so following it would violate the contract.Scope and terminal hardening
Nodeis the static-pod terminal. A customNodekind from another API group collapses like any other controller.Known gaps for the production-adapter PR
Refcarries no UID. If a Pod still references deleted Job A and a new Job with the same name exists, the walk follows the new Job to that Job's root. The adapter needs to carry the owner UID (resourceid.OwnerReferencekeeps it) and check it at each hop.OwnerResolverandDefaultOperatorRoots.Owners, this full controller walk goes past the operator CR before the hook runs. CNPG and similar subjects then anchor asowner_collapsed, neveroperator_cr. The first consumer must decide where the operator boundary sits and test the wholeSubject, includingAnchor.ScopeForKindstill classifies by Kind alone.Source revalidation
Verification
(cd pkg && go test ./subject ./resourceid)go build ./...and(cd pkg && go build ./...)go test ./internal/cloudinstallgit diff --checkVisual testing was skipped because this has no rendered UI path or production consumer change.
Part of RAD-418.
Note
Low Risk
New isolated resolver with tests only; the small
ResolveSubjectNode guard change is unlikely to affect current callers that mostly use overlay resolution, not owner walks.Overview
Introduces
ControllerOwnerResolver, a Tier-1OwnerResolverthat walks onlyownerReferenceswithcontroller=truevia injected object lookup. Parent refs keep the exact API group (fromGroupFromAPIVersion), kind, and owner name; namespace is inferred from anIsNamespaced(group, kind)callback. For namespaced children, resolution fails closed when owner scope is unknown; cluster-scoped children reject a known namespaced controller.Adds a broad parity test corpus (Deployment, CronJob, Rollout, JobSet, Ray, CNPG, Strimzi, Crossplane) covering multi-hop
ResolveSubjectcollapse, partial cache (stop at unobserved parent), and edge cases (non-controller owners, incomplete refs, core vs customNode).ResolveSubjectnow treatsNodeas a terminal anchor only for the core API group (Group == ""), so a CRD kind namedNodecan still collapse up the controller chain. Package docs and theOwnerResolvercontract are updated to describe object-backed vs heuristic behavior. No production wiring in this PR—the resolver is foundation-only.Reviewed by Cursor Bugbot for commit 35754e0. Bugbot is set up for automated code reviews on this repo. Configure here.