Skip to content

refactor(workloadmanager): replace dynamic informers with typed clientset informers #356

@Maximus-08

Description

@Maximus-08

What would you like to be added:

Replace the Workload Manager's dynamic informers for AgentRuntime and CodeInterpreter with the generated typed clientset informers under client-go/informers/externalversions.

Today pkg/workloadmanager/informers.go wires these CRDs through dynamicInformer.ForResource(...), and pkg/workloadmanager/workload_builder.go converts cached unstructured.Unstructured objects back into typed runtime objects. Existing TODO for this at the buildSandboxByAgentRuntime and buildSandboxByCodeInterpreter lookup paths by @hzxuzhonghu .

Proposed scope:

  • Add/use the generated AgentCube versioned clientset in K8sClient.
  • Add a typed AgentCube informer factory from client-go/informers/externalversions.
  • Wire AgentRuntimeInformer and CodeInterpreterInformer from the typed factory.
  • Start and sync the typed informer factory alongside the core Kubernetes informer factory.
  • Update workload builder code to consume typed *runtimev1alpha1.AgentRuntime and *runtimev1alpha1.CodeInterpreter objects directly.
  • Remove the unstructured conversion path for these two cached runtime resources.

Why is this needed:

The generated typed informers already exist in the repo but the Workload Manager still uses dynamic informers for AgentCube runtime resources. Moving to typed informers improves type safety removes conversion boilerplate, resolves the existing TODOs, and makes future workload-manager changes easier to test and maintain.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions