Repository navigation
Fix switch.hosted.boxes_by_image always reading unknown - #2531
Merged
Merged
Conversation
The box scaler reported a box's image only from its live pod, so a sleeping box sent none and stayed `unknown` in the gauge. With every owned box asleep, the gauge couldn't show the update pass moving them. When there is no live pod, the scaler now reports the box container's image from the StatefulSet's pod template, which the update pass patches while the box sleeps: the image it wakes on. It is read from the StatefulSet `scale` already fetches each pass, so no new Kubernetes call and no RBAC change. A live pod's image still wins. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
amaudruz
requested review from
abeldantas,
agent-runner353,
christian-mcdermott,
lbangalosbt,
massimo-sandboxaq,
niall-sandboxaq,
petr-sandbox,
raullopez-sandbox and
simonflk-sb
as code owners
December 4, 2026 20:59
Split-template boxes run `controller` and `agents`, with no container named `box`, so `box_image` never found an image and every box was `unknown` in switch.hosted.boxes_by_image, awake or asleep. The start-step timing had the same check and lost its `initialized_to_started` step on those boxes. Both now look for `agents` first, then `box` for boxes still on the older single-container template. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Why
On dev,
switch.hosted.boxes_by_imageputs every owned box underunknown, including boxes that are running, so it can't show a box image rollout moving boxes. There are two causes in the box operator:box_imageonly looks for a container namedbox. Split-template boxes runcontrollerandagents, so it never finds an image, and Core never gets one.start_stepshas the same check, so split boxes also lose theirinitialized_to_startedtiming.What
box_image,template_imageand the start-step timing now look for theagentscontainer first, thenboxfor boxes still on the older single-container template.controllerruns the same image asagents.scale()already fetches each pass (KubeApi.last_template_image), so there's no new Kubernetes call and no RBAC change, and the committed contract run is unchanged.Observation.imageand theswitch.hosted.boxes_by_imagecatalogue description change.Tests
agents, start step timed fromagents), the template image, a sleeping box reporting its template image, a live pod winning over the template, andKubeApikeeping the imagescaleread. Full controller suite passes (1648 passed).tests/switch_core/observabilitypasses.Rollout
Takes effect once a new
switch-box-workersimage with this change is promoted to an environment. Dev's operator runsbox-workers@sha256:9bd90528…, which predates this.🤖 Generated with Claude Code