fix(crd): align AgentRuntime CRD with CodeInterpreter annotations and types#210
Conversation
… types Signed-off-by: Mahil Patel <mahilpatel0808@gmail.com>
Summary of ChangesHello @mahil-2040, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request standardizes the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly aligns the AgentRuntime CRD with the CodeInterpreter CRD by adding the necessary kubebuilder annotations, status fields, and list types. This enables the generation of a typed client-go clientset, informers, and listers, which are all correctly included. The CRD manifest is also properly updated to enable the status subresource and add a printer column for better kubectl usability. The changes are well-executed and follow standard practices for Kubernetes CRD development. I have one minor suggestion to improve code clarity by removing a redundant variable.
Signed-off-by: Mahil Patel <mahilpatel0808@gmail.com>
There was a problem hiding this comment.
Pull request overview
Aligns the AgentRuntime CRD/type definitions with the existing CodeInterpreter patterns so controller-gen and client-go generation produce full deep-copies, list types, and typed clients, while also improving kubectl UX (Age column) and enabling status subresource updates.
Changes:
- Added missing kubebuilder/codegen annotations plus
AgentRuntimeListand scheme registration forAgentRuntime. - Extended
AgentRuntimeStatuswithconditionsandreadyand updated generated deep-copy code accordingly. - Regenerated CRD YAML + client-go typed clientset/informers/listers to include
AgentRuntime, including status subresource and anAgeprinter column.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/runtime/v1alpha1/agent_type.go | Adds kubebuilder annotations, AgentRuntimeList, and status fields; registers types with SchemeBuilder. |
| pkg/apis/runtime/v1alpha1/register.go | Adds exported type metadata vars for AgentRuntime to match existing CodeInterpreter pattern. |
| pkg/apis/runtime/v1alpha1/zz_generated.deepcopy.go | Generated deep-copy updates for AgentRuntime(Status) and new AgentRuntimeList + DeepCopyObject methods. |
| manifests/charts/base/crds/runtime.agentcube.volcano.sh_agentruntimes.yaml | Enables status subresource, adds Age printer column, and updates schema for new status fields. |
| client-go/listers/runtime/v1alpha1/expansion_generated.go | Adds lister expansion hooks for AgentRuntime (generated). |
| client-go/listers/runtime/v1alpha1/agentruntime.go | Adds AgentRuntime lister implementation (generated). |
| client-go/informers/externalversions/runtime/v1alpha1/interface.go | Exposes AgentRuntimes() informer on the runtime/v1alpha1 informer interface (generated). |
| client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go | Adds AgentRuntimeInformer implementation (generated). |
| client-go/informers/externalversions/generic.go | Adds generic informer mapping for agentruntimes resource (generated). |
| client-go/clientset/versioned/typed/runtime/v1alpha1/runtime_client.go | Adds typed getter for AgentRuntimes() (generated). |
| client-go/clientset/versioned/typed/runtime/v1alpha1/generated_expansion.go | Adds typed client expansion hook for AgentRuntime (generated). |
| client-go/clientset/versioned/typed/runtime/v1alpha1/fake/fake_runtime_client.go | Adds fake typed getter for AgentRuntimes() (generated). |
| client-go/clientset/versioned/typed/runtime/v1alpha1/fake/fake_agentruntime.go | Adds fake typed client for AgentRuntime (generated). |
| client-go/clientset/versioned/typed/runtime/v1alpha1/agentruntime.go | Adds typed client interface/implementation for AgentRuntime (generated). |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
+ Coverage 35.60% 42.04% +6.43%
==========================================
Files 29 30 +1
Lines 2533 2590 +57
==========================================
+ Hits 902 1089 +187
+ Misses 1505 1369 -136
- Partials 126 132 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Mahil Patel <mahilpatel0808@gmail.com>
|
@hzxuzhonghu can you please review this PR? |
| // Conditions represent the latest available observations of the AgentRuntime's state | ||
| // +optional | ||
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
|
|
||
| // Ready indicates whether the AgentRuntime is ready to serve requests | ||
| // +optional | ||
| Ready bool `json:"ready,omitempty"` |
There was a problem hiding this comment.
can you please remove this first, I would rather vote for Accepted than Ready
There was a problem hiding this comment.
Done, can you check it now?
Signed-off-by: Mahil Patel <mahilpatel0808@gmail.com>
11baf2b to
e9aa355
Compare
|
hey @hzxuzhonghu i have made the changes you asked for can you take a look at it? |
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Namespaced | ||
| // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" |
There was a problem hiding this comment.
can you please show the kubectl get AgentRuntime output?
I guess this is generated by AI
There was a problem hiding this comment.
Thanks for the review and merge!
To clarify regarding the code style - I used CodeInterpreter it as a direct reference to ensure AgentRuntime has consistent behavior and structure. That similarity is intentional, not just auto-generated.
Here is the kubectl get agentruntimes output from my local verification, it confirms that AGE column is present and working as expected:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR adds missing kubebuilder annotations and types to the AgentRuntime CRD to achieve consistency with the CodeInterpreter CRD and enable proper typed client-go generation.
Changes
+genclient,+k8s:deepcopy-gen:interfaces,+kubebuilder:object:root=true,+kubebuilder:subresource:status, etc.) to theAgentRuntimetypeAgentRuntimeListtype for Kubernetes list operationsConditionsfield toAgentRuntimeStatusto enable status reportingregister.go(AgentRuntimeKind, etc.)AgentRuntimeAgecolumn tokubectl get agentruntimesoutput viaadditionalPrinterColumnsWhich issue(s) this PR fixes:
Fixes #209
Special notes for your reviewer:
Most files in
client-goand the CRD manifest are auto-generated bymake gen-all(which runscontroller-gen,client-gen,lister-gen, andinformer-gen).The core manual changes are limited to:
agent_type.go— added kubebuilder annotations,AgentRuntimeList, and status fieldsregister.go— added type metadata variablesagentruntime.go— fixed.GroupResource()call to match theCodeInterpreterpatternVerification
make gen-checkmake lintAll checks pass successfully.
Does this PR introduce a user-facing change?: