add AgentRuntimePolicy CR - #4016
Conversation
Soffi AI SummaryThis PR introduces a new The implementation spans the full controller stack:
Commits
Updated: 2026-08-19 08:43 UTC |
Greptile SummaryThis PR introduces a cluster-scoped AgentRuntimePolicy CRD and controller that applies centrally managed create bindings to management-cluster agent runtimes.
Confidence Score: 2/5The PR is not safe to merge until Console-side policy drift is restored reliably and every binding form accepted by the CRD is either supported or rejected. The controller can report a policy synchronized while out-of-band create permissions remain active, and accepted ID-based binding inputs are discarded before the Console update. Files Needing Attention: go/controller/internal/controller/agentruntimepolicy_controller.go, go/controller/api/v1alpha1/agentruntimepolicy_types.go
|
| Filename | Overview |
|---|---|
| go/controller/internal/controller/agentruntimepolicy_controller.go | Adds the core reconciliation flow, but misses external binding drift and silently drops ID-based binding identities. |
| go/controller/api/v1alpha1/agentruntimepolicy_types.go | Defines the new cluster-scoped policy and spec hashing; using the broad shared Binding type exposes identity forms the reconciler cannot apply. |
| go/controller/internal/client/agentruntime.go | Adds the typed upsert wrapper; unrelated omitted runtime attributes are preserved by the Console update implementation. |
| go/controller/internal/controller/agentruntimepolicy_controller_test.go | Covers initial synchronization and missing runtimes but not out-of-band binding drift or ID-based bindings. |
| charts/controller/crds/deployments.plural.sh_agentruntimepolicies.yaml | Packages the new CRD schema, including the shared binding fields that are not all supported by reconciliation. |
| go/controller/config/rbac/role.yaml | Adds the expected resource, status, and finalizer permissions for the new CRD. |
Reviews (1): Last reviewed commit: "add AgentRuntimePolicy CR" | Re-trigger Greptile
| // Runtime is the name of the AgentRuntime this policy applies to. | ||
| // Defaults to metadata.name if not specified. | ||
| // +kubebuilder:validation:Optional | ||
| Runtime *string `json:"runtime,omitempty"` |
There was a problem hiding this comment.
where is the cluster specified here?
| } | ||
|
|
||
| func (in *AgentRuntimePolicyReconciler) getAgentRuntime(ctx context.Context, runtimeName string) (*console.AgentRuntimeFragment, string, *ctrl.Result, error) { | ||
| cluster, err := in.ConsoleClient.GetClusterByHandle(lo.ToPtr(managementClusterHandle)) |
There was a problem hiding this comment.
we shouldn't assume this is on the management cluster, it should be in the agent runtime policy spec.
|
@michaeljguarino PTAL |
michaeljguarino
left a comment
There was a problem hiding this comment.
lgtm but ideally we resolve the failing gh actions
Test Plan
Test environment: https://console.plrl-dev-aws.onplural.sh
Checklist
Plural Flow: console