Repository navigation
fix: count AB2 sandbox pool CRs by app=sandbox in setup-ocp.sh pre-poll - #105
Merged
pdettori merged 1 commit intoJul 14, 2026
Merged
Conversation
The SH_AUTHBRIDGE=1 pool readiness pre-poll derived its target container count (ab2_want) from `kubectl get sandbox -l sh.kagenti.io/sandbox-pool=default`. That label lives only on the pod template (podTemplate.metadata.labels) for pod discovery; the Sandbox CR's own metadata.labels is just `app=sandbox`. A `get sandbox -l` selector matches the CR's own labels, so the query returned 0 rows, ab2_want stayed 0, the loop's `[ "$ab2_want" -gt 0 ]` early-break never fired, and the poll burned its full ~150x2s ~= 5 minute budget before the authoritative `kubectl wait` gated. Count the CRs by app=sandbox (a label they actually carry) via a new AB_SANDBOX_SELECTOR; pod-based operations keep AB_POOL_SELECTOR. Live OCP: `-l sh.kagenti.io/sandbox-pool=default` -> 0 CRs, `-l app=sandbox` -> 3 CRs. Adds a cross-file manifest-shape regression test tying the script's get-sandbox count selector to a label present on the Sandbox CRs in sandbox-pool-ab2.yaml. Fixes rossoctl#103 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
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
Fixes #103. The
SH_AUTHBRIDGE=1sandbox-pool readiness pre-poll indeploy/knative/setup-ocp.shcomputed its target container count from a label that theSandboxCR does not carry, soab2_wantwas always0, the early-break never fired, and the poll spun its full ~5-minute budget before the authoritativekubectl wait.Root cause
kubectl get sandbox -l <sel>matches the CR's ownmetadata.labels(app: sandbox). Thesh.kagenti.io/sandbox-pool=defaultlabel lives only onpodTemplate.metadata.labelsfor pod discovery — which is why the siblingab2_readypod query is correct and unchanged.Fix
Introduce
AB_SANDBOX_SELECTOR="app=sandbox"for the CR count; pod-based operations keepAB_POOL_SELECTOR. One-line semantic change; correctness was never affected (the authoritativekubectl waitstill gated) — this only removes the wasted ~5m.Verification
Live OCP 4.20 (
defaultns, 3 pool CRs):ab2_wantsh.kagenti.io/sandbox-pool=default(before)app=sandbox(after)CR's own labels =
{"app":"sandbox"}; the pod carries the pool label.bash -n+shellcheck -S errorclean.Regression test (
packages/knative-server/test/authbridge-manifests.test.ts): a pure file-parsing, cross-file invariant that extracts the script'sget sandbox -lcount selector (resolving the shell var) and asserts it matches a label present on the Sandbox CRs insandbox-pool-ab2.yaml. Fails on the old selector, passes on the fix. Runs in the existingpnpm -r testCI — no cluster.Assisted-By: Claude Code