feat: support memory resize for sandbox claims#519
Conversation
- Allow SandboxClaim inplaceUpdate.resources and E2B extensions to resize memory in addition to CPU. - Patch the pods/resize subresource instead of sending a full subresource update so existing container resizePolicy entries are preserved by the API server. - Add unit and e2e coverage for CPU and memory resize behavior, including RestartContainer and NotRequired resizePolicy cases.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #519 +/- ##
==========================================
+ Coverage 79.23% 79.42% +0.18%
==========================================
Files 184 189 +5
Lines 12971 13432 +461
==========================================
+ Hits 10278 10668 +390
- Misses 2317 2373 +56
- Partials 376 391 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: PersistentJZH <zhihao.kan17@gmail.com> Generate the Pod resize strategic merge patch directly instead of building a Pod-shaped resize body and converting it later. This keeps the resize payload scoped to changed regular containers and avoids carrying unrelated fields such as initContainers, metadata, or resizePolicy through the resize path. Also add regression coverage for Pods with init containers to ensure main-container resize does not mutate init container resources.
Ⅰ. Describe what this PR does
SandboxClaim resource resize previously only supported CPU. Kubernetes in-place pod resize supports both CPU and memory, with behavior controlled by the pod container
resizePolicy.Memory resize should be supported through both the CRD API and the E2B-compatible API path, while preserving the resize policy already defined on the underlying SandboxSet/Sandbox pod template.
Allow SandboxClaim inplaceUpdate.resources and E2B extensions to resize memory in addition to CPU.
Patch the pods/resize subresource instead of sending a full subresource update so existing container resizePolicy entries are preserved by the API server.
Add unit and e2e coverage for CPU and memory resize behavior, including RestartContainer and NotRequired resizePolicy cases.
Ⅱ. Does this pull request fix one issue?
#515
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews