Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

deprecate: remove Agent CRD, controller, and legacy support - #183

Merged
pdettori merged 4 commits into
rossoctl:mainfrom
pdettori:deprecate/remove-agent-crd
Feb 23, 2026
Merged

pdettori merged 4 commits into
rossoctl:mainfrom
pdettori:deprecate/remove-agent-crd

Conversation

@pdettori

Copy link
Copy Markdown
Member

Summary

  • Remove the Agent CRD controller, types, RBAC roles, samples, and all supporting packages (internal/rbac, internal/distribution)
  • Remove the deprecated Selector field and AgentSelector type from AgentCard
  • Remove the isOwnedByAgentCRD guard from the AgentCardSync controller
  • Clean up main.go (remove AgentReconciler setup, enableClientRegistration flag, distribution detection)
  • Update documentation to reflect the Deployment-first model with targetRef-based AgentCard discovery
  • Regenerate deepcopy, CRD manifests, and RBAC (10,818 lines removed, 242 added)

Closes #168

Test plan

  • make generate — deepcopy regenerated (Agent/AgentSelector removed)
  • make manifests — CRDs and RBAC regenerated (agents resource removed from role.yaml, selector removed from AgentCard CRD)
  • make build — compiles successfully
  • make test — all unit tests pass
  • make fmt && make vet — no lint issues

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the deprecation of the legacy Agent CRD workflow by removing the Agent CRD/controller and related supporting packages, shifting the operator to a Deployment-first model where AgentCard uses spec.targetRef to bind to Deployments/StatefulSets for discovery.

Changes:

  • Remove Agent CRD/controller, legacy selector-based support, and platform/distribution detection & RBAC manager utilities.
  • Enforce AgentCard.spec.targetRef as the single binding mechanism (types/CRD/webhook/tests updated accordingly).
  • Update RBAC manifests, docs, and samples to match Deployment-first discovery and regenerated manifests/codegen.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
kagenti-operator/internal/webhook/v1alpha1/agentcard_webhook.go Tightens validation messaging around required spec.targetRef and drops legacy selector warning logic.
kagenti-operator/internal/rbac/rbac_manager.go Removes legacy per-Agent RBAC management helper.
kagenti-operator/internal/distribution/detect.go Removes platform distribution detection logic (previously used by Agent controller).
kagenti-operator/internal/controller/agentcardsync_controller.go Removes legacy guard that skipped workloads owned by the removed Agent CRD.
kagenti-operator/internal/controller/agentcard_controller_test.go Updates tests to use targetRef only (no selector).
kagenti-operator/internal/controller/agent_controller_test.go Removes tests for the deleted Agent controller.
kagenti-operator/internal/controller/agent_controller.go Removes the legacy Agent reconciler implementation.
kagenti-operator/docs/operator.md Updates operator overview and diagrams to Deployment-first + AgentCard discovery.
kagenti-operator/docs/dynamic-agent-discovery.md Updates discovery docs/examples to workload + targetRef model.
kagenti-operator/docs/architecture.md Updates architecture description/diagrams to remove Agent controller and emphasize AgentCard/Sync controllers.
kagenti-operator/docs/api-reference.md Removes Agent API reference and updates AgentCard spec docs to targetRef (+ identityBinding fields).
kagenti-operator/config/samples/weather-agent-source-deployment.yaml Removes legacy Agent sample.
kagenti-operator/config/samples/weather-agent-image-deployment.yaml Removes legacy Agent sample.
kagenti-operator/config/samples/weather-agent-build.yaml Removes legacy sample tied to Agent CR workflow.
kagenti-operator/config/samples/weather-agent-build-and-deploy.yaml Removes legacy combined build+Agent sample.
kagenti-operator/config/rbac/role.yaml Regenerates manager ClusterRole rules to drop Agent resources and other legacy permissions.
kagenti-operator/config/rbac/kustomization.yaml Removes Agent RBAC role resources from the kustomization.
kagenti-operator/config/rbac/agent_viewer_role.yaml Removes Agent-specific viewer role.
kagenti-operator/config/rbac/agent_editor_role.yaml Removes Agent-specific editor role.
kagenti-operator/config/rbac/agent_admin_role.yaml Removes Agent-specific admin role.
kagenti-operator/config/crd/kustomization.yaml Removes Agent CRD from CRD kustomization resources.
kagenti-operator/config/crd/bases/agent.kagenti.dev_agentcards.yaml Removes deprecated selector schema from AgentCard CRD.
kagenti-operator/cmd/main.go Cleans main: removes distribution detection, AgentReconciler setup, and the client registration flag.
kagenti-operator/api/v1alpha1/zz_generated.deepcopy.go Regenerates deepcopy removing Agent/Selector-related deepcopy functions and types.
kagenti-operator/api/v1alpha1/agentcard_types.go Removes deprecated Selector field and AgentSelector type from AgentCard API.
kagenti-operator/api/v1alpha1/agent_types.go Removes legacy Agent API types entirely.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kagenti-operator/config/rbac/role.yaml Resolved
@cwiklik

cwiklik commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

@paolo, there a bunch of agent CR related files in charts to cleanup.

@pdettori
pdettori force-pushed the deprecate/remove-agent-crd branch 3 times, most recently from f9a2dd2 to a96d888 Compare February 20, 2026 16:27
@cwiklik

cwiklik commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

@paolo, should the README.md be cleared of Agent CR references. There are few mentions of it with the fact that this CR was deprecated. Given that this CR is no longer there, the references should be removed.

cooktheryan and others added 4 commits February 20, 2026 12:00
Signed-off-by: Ryan Cook <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…#168)

Complete the migration to the Deployment-first model by removing all
Agent CRD infrastructure. Users now create standard Deployments or
StatefulSets and use AgentCard CRs with targetRef for discovery.

Removed:
- Agent controller, types, and tests
- Agent CRD YAML and kustomization entries
- Agent RBAC roles (admin/editor/viewer)
- internal/rbac and internal/distribution packages
- Legacy Agent CRD sample files
- isOwnedByAgentCRD guard in AgentCardSync controller
- Deprecated Selector field and AgentSelector type from AgentCard

Updated:
- main.go: remove AgentReconciler, enableClientRegistration flag, distribution detection
- Webhook: remove selector deprecation warning
- Documentation: operator.md, architecture.md, api-reference.md, dynamic-agent-discovery.md

Regenerated:
- deepcopy (Agent/AgentSelector removed)
- CRD manifests (selector field removed from AgentCard)
- RBAC role.yaml (agents resource removed)

Closes rossoctl#168

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Remove agent.kagenti.dev_agents.yaml CRD, agent admin/editor/viewer
roles, and agents resource references from the manager ClusterRole.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Remove deprecated Agent CRD from the CRD table, deprecation notice,
Agent Controller from controller table, migration guide link, and
dead sample file reference.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori
pdettori force-pushed the deprecate/remove-agent-crd branch from 8ccb950 to f6ce062 Compare February 20, 2026 17:00

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm;

@pdettori
pdettori merged commit f1565e4 into rossoctl:main Feb 23, 2026
2 checks passed
@pdettori
pdettori deleted the deprecate/remove-agent-crd branch February 23, 2026 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate Agent CRD Support

4 participants