Skip to content

refactor(api): Rename A2A Custom Resource Definition to Agent#36

Merged
edenreich merged 8 commits intomainfrom
claude/issue-35-20250801-1302
Aug 1, 2025
Merged

refactor(api): Rename A2A Custom Resource Definition to Agent#36
edenreich merged 8 commits intomainfrom
claude/issue-35-20250801-1302

Conversation

@edenreich
Copy link
Copy Markdown
Collaborator

This major refactoring renames the A2A (Agent-to-Agent) CRD to simply "Agent" for better usability and intuitive kubectl commands.

Summary

  • Users can now run kubectl get agents instead of kubectl get a2as
  • Renamed all API types from A2A to Agent
  • Updated controllers, examples, and manifests
  • All tests passing and linting clean

Breaking Changes

This requires existing A2A resources to be migrated to the new Agent kind.

Related

Closes #35

Generated with Claude Code

claude bot and others added 7 commits August 1, 2025 13:06
This major refactoring renames the A2A (Agent-to-Agent) CRD to simply "Agent" 
for better usability and intuitive kubectl commands.

## Changes Made:

### API Types
- Renamed `A2ASpec` → `AgentSpec`
- Renamed `A2AStatus` → `AgentStatus` 
- Renamed `A2A` → `Agent`
- Renamed `A2AList` → `AgentList`
- Renamed Gateway field `A2A` → `Agents`
- Renamed all A2A-related types to Agent equivalents

### Controllers
- Renamed `A2AReconciler` → `AgentReconciler`
- Updated all controller logic to use new Agent types
- Updated RBAC permissions from `a2as` to `agents`

### Examples & Samples
- Updated example files to use `kind: Agent`
- Renamed example files for clarity
- Updated Gateway examples to use `agents:` field

### Generated Files
- Regenerated DeepCopy methods for new API types
- Updated CRDs and manifests
- Updated RBAC permissions

## Breaking Changes
This is a breaking change that requires existing A2A resources to be migrated.
Users can now run `kubectl get agents` instead of `kubectl get a2as`.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>"
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…scovery.yaml

Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
It makes sense because it just registers those agents and knowing what protocol to use mcp or a2a then makes a lot of sense in the Gateway context.

Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich
Copy link
Copy Markdown
Collaborator Author

@claude /review

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Aug 1, 2025

Claude finished @edenreich's task —— View job


PR Review: Rename A2A CRD to Agent

I've completed a comprehensive review of this major refactoring that renames the A2A (Agent-to-Agent) CRD to simply "Agent".

Strengths

  1. API Design Improvement: The rename from A2A to Agent significantly improves usability - kubectl get agents is much more intuitive than kubectl get a2as

  2. Comprehensive Refactoring: The rename is thorough across the codebase:

    • API types properly renamed (api/v1alpha1/agent_types.go)
    • Controller implementation updated (internal/controller/agent_controller.go)
    • RBAC permissions correctly updated
    • CRDs and manifests regenerated
    • Examples updated with proper resource definitions
  3. Proper Test Coverage: Added new agent_controller_test.go with appropriate Ginkgo-style tests that verify deployment and service creation

  4. Clean Code Structure: The controller follows good patterns with proper error handling, retry logic, and conflict resolution

⚠️ Critical Issues

Major Inconsistency in Gateway Integration

The most significant issue is that while the Agent CRD was renamed, the Gateway CRD still references the old A2A naming throughout:

In api/v1alpha1/gateway_types.go:184:

// A2A (Agent-to-Agent) configuration  
A2A *A2AServersSpec `json:"a2a,omitempty"`

In internal/controller/gateway_controller.go:508-520:

if gateway.Spec.A2A != nil && gateway.Spec.A2A.Enabled {
    envVars = append(envVars,
        corev1.EnvVar{
            Name:  "A2A_ENABLE", 
            Value: fmt.Sprintf("%t", gateway.Spec.A2A.Enabled),
        },
        // ... more A2A environment variables

This creates a confusing situation where:

  • Users create Agent resources with kubectl get agents
  • But Gateway specs still reference A2A configuration
  • Environment variables are still prefixed with A2A_

🔧 Recommendations

1. Complete the Gateway Rename (High Priority)

The Gateway CRD should be updated to use agents instead of a2a:

  • Rename A2A *A2AServersSpec to Agents *AgentServersSpec in gateway_types.go
  • Update environment variable names from A2A_* to AGENT_*
  • Update all related struct names (A2AServersSpecAgentServersSpec, etc.)

2. Migration Documentation

Since this is a breaking change, consider:

  • Adding migration scripts or instructions
  • Versioning the API to support both during transition
  • Clear documentation about the breaking changes

3. Consider Semantic Versioning

This level of API change might warrant a version bump (e.g., v1alpha2) to signal the breaking nature.

📋 Minor Issues

  1. Comment Inconsistency: Some comments still reference "A2A (Agent-to-Agent)" when they should just say "Agent"

  2. Test Coverage Gap: The deleted a2a_controller_test.go had 143 lines vs new agent_controller_test.go with 106 lines - verify all test scenarios are covered

Overall Assessment

This is a well-executed refactoring that improves the API's usability, but it's incomplete. The Gateway integration still uses A2A terminology, creating a confusing mixed state. The PR should either:

  1. Complete the rename by updating Gateway CRD and controller references
  2. Split the work and clearly document that this is Phase 1 of a larger rename effort

Recommendation: Complete the Gateway integration updates before merging to avoid confusion for users.


@edenreich
Copy link
Copy Markdown
Collaborator Author

edenreich commented Aug 1, 2025

I left the Gateway manifest calling it A2A because that's the name of the protocol a user intending to use, it connects to other agents (so I'm just renaming the A2A kind resource to Agent because it feels more natural - internally the A2A kind resource can use MCP or Standard Tool-Use) but what's make an Agent is the A2A Server. They are only connecting via A2A.

…ver.yaml

Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich
Copy link
Copy Markdown
Collaborator Author

Screenshot 2025-08-01 at 18 13 47

TODO - I need to update the Inference Gateway Service Discovery to look for Agent CRD instead of A2A.

@edenreich edenreich merged commit e68cadf into main Aug 1, 2025
5 checks passed
@edenreich edenreich deleted the claude/issue-35-20250801-1302 branch August 1, 2025 16:15
ig-semantic-release-bot bot added a commit that referenced this pull request Aug 1, 2025
## [0.12.1](v0.12.0...v0.12.1) (2025-08-01)

### ♻️ Improvements

* **api:** Rename A2A Custom Resource Definition to Agent ([#36](#36)) ([e68cadf](e68cadf))

### 🔧 Miscellaneous

* **issue-templates:** Add bug report, feature request, and refactor request templates ([dd77567](dd77567))
@ig-semantic-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.12.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Renaming A2A Custom Resource Definition to Agent

1 participant