Repository navigation
refactor(kubernetes): read the Orchestrator status contract from the operator's api/v1alpha1 - #1770
Merged
Merged
Conversation
…operator's api/v1alpha1 The Kubernetes workspace adapter compared the Orchestrator's condition type with a copied "Ready", failed fast on copied "SandboxCRDMissing" and "InvalidSpec" reasons, and wrote a copied agents-done message. Operator v0.33.0 exports all three from api/v1alpha1, so the adapter reads them from there and a renamed value fails the build instead of a teleport. The fail-fast list keeps the same two reasons. SandboxSuspended also needs a spec change, which awaitReady makes itself by resuming the Orchestrator. The operator module is confined to the two Kubernetes adapters by the same depguard rule as client-go. It adds about 0.87MB to the stripped binary.
Contributor
|
🎉 This PR is included in version 0.250.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The Kubernetes workspace adapter copied the Orchestrator's status contract as string literals, so a renamed value in the operator would break a teleport without a compile error. Operator v0.33.0 exports the contract from
api/v1alpha1(inference-gateway/operator#322), and the adapter now reads it from there:readyConditioninworkspace.gomatches the condition typeOrchestratorConditionReady.unrecoverableReasonsinworkspace.go, the reasons a teleport fails fast on, areReasonSandboxCRDMissingandReasonInvalidSpec.ReportIdleinself.gowritesAgentsDoneMessagewhen every agent is done.The fail-fast list keeps the same two reasons. Their doc comments in the operator say they need a change to the cluster or the spec.
ReasonSandboxSuspendedneeds a spec change too, butawaitReadymakes it itself by resuming the Orchestrator, and the doc comment now says so.GatewayNotFound,SandboxNotReadyandDeploymentNotAvailablecan clear on their own, so a teleport keeps waiting on them.Closes #1769
Dependency
go.modrequiresgithub.com/inference-gateway/operatorv0.33.0. It uses the samek8s.iov0.37.2 modules as the CLI, addssigs.k8s.io/gateway-apias an indirect dependency, and movesgithub.com/google/gnostic-modelsfrom v0.7.0 to v0.7.1.puregobinary grows by about 0.87MB, from 81.92MB to 82.79MB.kubernetes-only-in-the-kubernetes-adaptersdepguard rule now also confinesgithub.com/inference-gateway/operatorto the two Kubernetes adapters. An import frominternal/sessionsis refused by that rule.operatorv1alpha1joins the canonical aliases inAGENTS.md, andinternal/agent/README.mdnames the operator's API types beside client-go.Compatibility
The values are unchanged, so every operator release that reports them keeps working. The workspace tests still build their fake Orchestrators and expected termination messages from the literal strings, so they pin the wire values the adapter has to match.
Verification
task testpasses.task test:e2e: every test passes exceptTestChatTUIAnswersAQuestion, which failed in both full runs. It is flaky without this change: run alone, it failed one of three runs on the commit before feat(workspaces): Kubernetes workspaces give their pods MCP servers #1767 and one of three on main. It passes when run alone on this branch twice.task precommit:runpasses.no docs ticket: internal-only refactor