You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(server): make resourceLimits/image/entrypoint optional when poolRef is set (#883)
* fix(server): make resourceLimits/image/entrypoint optional when poolRef is set
When creating a sandbox from a pre-configured Pool (via extensions.poolRef),
the image, entrypoint, and resourceLimits are all defined in the Pool CRD
template. Requiring callers to provide dummy values for these fields is
unnecessary and error-prone.
Changes:
- Make resource_limits Optional with None default in CreateSandboxRequest
- Skip image/snapshotId/entrypoint validation when poolRef is present
- Add explicit resourceLimits required check for non-pool requests
- Guard against None resource_limits in Docker provider code paths
* fix(server): address review feedback for pool mode optional fields
- Skip image/entrypoint resolution in K8s service layer when poolRef is set
- Reject poolRef on Docker provider (unsupported)
- Reject snapshotId when poolRef is set (conflicting fields)
- Update specs/sandbox-lifecycle.yml: remove required constraint on
resourceLimits, document pool mode behavior
- All 1038 tests pass
* fix: guard _ensure_image_auth_support against None image, align spec docs
- Fix AttributeError when image is None in pool mode (P1)
- Clarify in spec that snapshotId is rejected (not optional) with poolRef
* test: add pool mode validation tests for poolRef, snapshotId rejection, Docker guard, and image auth
- Schema: poolRef-only happy path, poolRef+snapshotId rejection, resourceLimits
still required without poolRef, blank poolRef ignored
- Docker: rejects poolRef with SANDBOX::UNSUPPORTED_POOL_REF
- K8s: pool mode skips image/entrypoint validation, image auth guard handles
None image without AttributeError
All 1046 tests pass (8 new).
* fix: normalize blank snapshotId to None in pool mode
When poolRef is set and snapshotId is whitespace-only (e.g. ' '),
the validator now clears it to None before returning. This prevents
downstream code from treating a truthy whitespace string as a real
snapshot ID (e.g. writing an invalid Kubernetes label).
Adds test_pool_mode_normalizes_blank_snapshot_id to cover this edge case.
---------
Co-authored-by: longsuizhi <longsuizhi@xiaomi.com>
0 commit comments