feat(lifecycle): expose pool allocation summary - #1481
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b41c366172
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
SDK consumer follow-up is now included in 9dcb245. Updated the affected stable get/list sandbox surfaces for Python, JavaScript, Kotlin, Go, and C#, with optional allocation omitted unchanged for legacy/non-Pool responses.
Verification passed:
C# tests are present but could not run locally because this host has only .NET SDK 8.0.129 while the project targets net10.0. Broader Kubernetes env/e2e suites are environment-blocked before assertions (missing envtest/KIND and disk exhaustion); the focused controller test passes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dcb24550c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 180f3c18e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
180f3c1 to
d8b75c8
Compare
Summary
Adds an optional lifecycle
Sandbox.allocationsummary for a currently confirmed Kubernetes Pool allocation:{ "allocation": { "mode": "pool", "poolRef": "example-pool", "state": "allocated" } }This is a narrow runtime core change only. It does not update SDKs, Gateway integrations, business APIs, CRDs, Pool scheduling behavior, or CreateSandbox responses.
Confirmation semantics
The Pool controller extends its existing internal allocation record with the concrete Pool reference and allocation generation. The lifecycle mapper emits the public summary only when it finds a non-deleting workload with a concrete non-wildcard
spec.poolRef, the Pool allocation finalizer, valid nonempty unique Pod evidence, an exact internal-record Pool-ref match, and matching allocated Pod count.The summary omits all unconfirmed cases, including direct sandboxes, legacy Pods-only records, missing/mismatched Pool references, invalid allocation records, deletion, and count mismatch. It does not expose Pod names, namespace, node/IP/UID, raw annotations, finalizers, or generation.
The internal generation is recorded for controller traceability but is intentionally not used as a public-evidence predicate: renewal of
spec.expireTimeand other non-allocation spec changes can advance CR generation without changing a valid Pool allocation.Closes #1479.
Verification
go test ./internal/controller -run "Test(Schedule|SetAllocation|SyncSandboxAllocation)" -count=1uv run --no-sync pytest tests/k8s/test_workload_mapper.py tests/test_routes_get_sandbox.py— 28 passeduv run --no-sync ruff check opensandbox_server/api/schema.py opensandbox_server/services/k8s/workload_mapper.py tests/k8s/test_workload_mapper.py tests/test_routes_get_sandbox.pygit diff --check