Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureAgentSandboxAPIsRegistered ¶
EnsureAgentSandboxAPIsRegistered checks that the apiserver exposes the agent-sandbox resources kagent needs (SandboxTemplate, SandboxClaim, Sandbox). Call this before creating or reconciling SandboxAgent when a sandbox backend is configured.
When CRDs are missing, the apiserver returns a *meta.NoKindMatchError (or similar); that surfaces as a clear prerequisite error instead of a late reconcile failure.
func FilterTranslatorOwnedTypesForList ¶
func FilterTranslatorOwnedTypesForList(cl client.Client, agent v1alpha2.AgentObject, translatorOwnedTypes []client.Object, backend Backend) ([]client.Object, error)
FilterTranslatorOwnedTypesForList returns the owned-resource types the reconciler should pass to FindOwnedObjects. It drops sandbox-backend-only types when the workload is not sandbox, so reconcile does not List agent-sandbox APIs on clusters where those CRDs are not installed.
translatorOwnedTypes is typically AdkApiTranslator.GetOwnedResourceTypes() (full set used for watches).
Types ¶
type Backend ¶
type Backend interface {
BuildSandbox(ctx context.Context, in BuildInput) ([]client.Object, error)
GetOwnedResourceTypes() []client.Object
// ComputeReady reflects implementation-specific status into condition pieces for Agent.status.
ComputeReady(ctx context.Context, cl client.Client, nn types.NamespacedName) (status metav1.ConditionStatus, reason, message string)
}
Backend builds sandbox CRD objects and evaluates their readiness.
type BuildInput ¶
type BuildInput struct {
Agent v1alpha2.AgentObject
PodTemplate corev1.PodTemplateSpec
WorkloadName string
ExtraLabels map[string]string
}
BuildInput carries the pod template for a Sandbox workload (agents.x-k8s.io Sandbox).