Skip to content

AgentCardSync controller does not watch Sandbox workloads #339

Description

@cwiklik

Summary

The AgentCardSyncReconciler watches Deployment and StatefulSet to auto-create AgentCard CRs for workloads with kagenti.io/type: agent + protocol labels. It does not watch Sandbox (agents.x-k8s.io/v1alpha1), so Sandbox-deployed agents never get an AgentCard auto-created.

Impact

With featureFlags.agentSandbox: true (intended default), Sandbox is the recommended workload type in the UI. Agents deployed as Sandbox are not discoverable via A2A protocol because no AgentCard exists for them.

Required Changes

  1. Add a third controller registration in SetupWithManager (similar to the Deployment/StatefulSet adapter pattern) using SandboxCRDExists() guard
  2. Add a ReconcileSandbox method that extracts labels from spec.podTemplate.metadata.labels via unstructured access
  3. Pass the Sandbox GVK to ensureAgentCard
  4. Add RBAC marker for agents.x-k8s.io sandboxes

Reference

Acceptance Criteria

  • Sandbox workload with kagenti.io/type: agent + protocol labels gets AgentCard auto-created
  • Existing Deployment/StatefulSet behavior unchanged
  • Controller does not crash when Sandbox CRD is not installed

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions