This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
🌱 Update AgentCard CRD - #170
Merged
Merged
Conversation
Signed-off-by: Paolo Dettori <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a targetRef field to the AgentCard CRD to enable referencing standard Kubernetes workloads (Deployments, StatefulSets, etc.) using duck typing, while deprecating the label-based selector field for backward compatibility.
Changes:
- Added
TargetRefstruct and field to AgentCard spec and status for explicit workload references - Created validation webhook to ensure either targetRef or selector is specified
- Updated Selector field from value to pointer type to make it optional
- Added new print columns to display workload kind and target name in kubectl output
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| api/v1alpha1/agentcard_types.go | Added TargetRef struct and fields; made Selector optional with deprecation |
| internal/webhook/v1alpha1/agentcard_webhook.go | New validation webhook enforcing targetRef/selector requirements |
| internal/controller/agentcard_controller.go | Added nil checks for optional Selector field |
| internal/controller/agentcardsync_controller.go | Updated Selector initialization to use pointer syntax |
| internal/controller/agentcard_controller_test.go | Updated test to use pointer for Selector |
| cmd/main.go | Registered AgentCard webhook with manager |
| config/crd/bases/agent.kagenti.dev_agentcards.yaml | Updated CRD with new targetRef fields and print columns |
| config/webhook/manifests.yaml | Added AgentCard validating webhook configuration |
| config/rbac/role.yaml | Removed 'update' verb for events resource |
| api/v1alpha1/zz_generated.deepcopy.go | Regenerated deepcopy functions for new pointer types |
| docs/plans/migrate-agentcard-controller-to-workloads.md | Comprehensive migration plan for multi-phase workload support implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Update AgentCard CRD to support standard k8s workload types for agents.
Warning
This is a stacked PR and it is based and depends on #169, which must be reviewed and merged before this PR is reviewed and merged.
Changes Made
Example AgentCard with targetRef
New kubectl Output Columns
Related issue(s)
Fixes #164
🤖 Assisted by Claude Code