Skip to content

[TASK] Refactor export the Orchestrator status contract from api/v1alpha1 #322

Closed

Description

@edenreich

Summary

The Orchestrator's status contract is defined as unexported string literals in internal/controller, so a client that reads it has to copy the strings. The CLI's Kubernetes workspace adapter (internal/agent/infrastructure/kubernetes in inference-gateway/cli) does exactly that, and a renamed value in the operator breaks it without a compile error.

What the CLI copies today:

Value Operator CLI
Condition type Ready literals in orchestrator_controller.go (Type: "Ready") workspace.go, readyCondition
Reasons InvalidSpec, SandboxCRDMissing literals passed to patchStatusNotReady workspace.go, unrecoverableReasons
Termination message agents-done=true agentsDoneMessage in orchestrator_sandbox.go self.go, ReportIdle

The CLI fails a teleport fast on an unrecoverable reason. If the operator renamed InvalidSpec, the CLI would no longer recognize it and would wait out its five minute ready timeout instead. GatewayNotFound is the third reason the controller reports and has no shared name either.

The types themselves are already consumable. api/v1alpha1 keeps controller-runtime out (the local schemeBuilder), and linking it into the CLI costs about 0.9MB (81.70MB to 82.62MB stripped) and adds sigs.k8s.io/gateway-api/apis/v1 and k8s.io/api/autoscaling/v2. Only the contract strings are missing. The CLI also builds its Orchestrators as untyped maps today, a CLI-side change to make once these are exported.

Proposed shape, in api/v1alpha1/orchestrator_types.go beside SandboxRunning and SandboxSuspended:

const (
	OrchestratorConditionReady = "Ready"

	ReasonInvalidSpec       = "InvalidSpec"
	ReasonSandboxCRDMissing = "SandboxCRDMissing"
	ReasonGatewayNotFound   = "GatewayNotFound"

	// AgentsDoneMessage is the termination message a pod daemon writes once
	// every agent on it is done, which lets the operator suspend the Sandbox.
	AgentsDoneMessage = "agents-done=true"
)

Acceptance Criteria

  • The Orchestrator Ready condition type, every reason the controller sets on it, and the agents-done termination message are exported from api/v1alpha1.
  • The controllers use the exported names, so no literal of them is left in internal/controller.
  • Each reason's doc comment says whether the Orchestrator can recover without a change to its spec or the cluster, which is how a client decides to fail fast or keep waiting.
  • The values stay unchanged, so released CLIs keep working.

Activity

  1. added
    refactor
    on Nov 8, 2026
  2. added theissue type on Nov 8, 2026
  3. moved this to Todo in 2026on Nov 8, 2026
  4. moved this from Todo to In progress in 2026on Nov 8, 2026
  5. moved this from In progress to QA in 2026on Nov 8, 2026
  6. inference-gateway-releaser commented on Nov 8, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.33.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. moved this from QA to Done in 2026on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions