Mark initializing when reserved only - #39
Conversation
Signed-off-by: kerthcet <kerthcet@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR refines how the virtual kubelet reports Pod status during provisioning by distinguishing between providers that reserve capacity synchronously (e.g., AWS instant fleet) and those that may accept a request without capacity committed yet (e.g., Modal). It updates the provider contract to return an additional reserved flag and aligns status reporting, polling behavior, and documentation accordingly.
Changes:
- Extend
provider.Provider.Provisionto return(instanceID, reserved, err)and propagate through all provider implementations (AWS/Modal/fake) and call sites. - Update vnode
CreatePodto emitProvisioningbeforeProvision, and only advance toInitializingimmediately whenreserved=true. - Tighten Modal client behavior by treating sandbox tag-read failures as fatal to reads, preventing unsafe “absent => terminated” conclusions.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/vnode/handler.go | Emit Provisioning before long-running Provision; advance to Initializing only when capacity is reserved. |
| pkg/vnode/handler_test.go | Add tests covering reserved vs unreserved behavior and safety during in-flight provisioning. |
| pkg/provider/provider.go | Change Provision interface to include reserved semantics and document guarantees. |
| pkg/provider/modal/modal.go | Implement reserved=false for fresh sandboxes; infer reserved on observed running adoption. |
| pkg/provider/modal/modal_test.go | Update tests to assert reserved semantics for Modal create/adopt paths. |
| pkg/provider/modal/client.go | Make tag read failures fail the overall read to avoid unsafe identity loss. |
| pkg/provider/fake/fake.go | Always return reserved=true for the in-memory provider. |
| pkg/provider/fake/fake_test.go | Update fake provider tests for new return signature and reserved semantics. |
| pkg/provider/aws/aws.go | Return reserved=true for all successful AWS provisions (instant fleet semantics). |
| pkg/provider/aws/aws_test.go | Update AWS tests for new return signature and reserved expectations. |
| internal/controller/nodeclaim_controller.go | Update comments to reflect “evidence of existence” via reserved provision or list observation. |
| internal/controller/nodeclaim_controller_test.go | Update fake provider to satisfy new Provision signature. |
| docs/status.md | Document new status timeline and meaning of unreserved ids. |
| docs/architecture.md | Removes mention of provider-count limit (now mismatched with API validation). |
| config/samples/nodepool.yaml | Comments out Modal provider in sample NodePool. |
| config/samples/deployment.yaml | Changes sample accelerator type from a100-80gb to a100-40gb. |
| api/v1alpha1/groupversion_info.go | Update PodReasonProvisioning / PodReasonInitializing semantics and evidence rules. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/lgtm |
InftyAI-Agent
left a comment
There was a problem hiding this comment.
Approved: PR has both lgtm and approved labels
InftyAI-Agent
left a comment
There was a problem hiding this comment.
Approved: PR has both lgtm and approved labels
InftyAI-Agent
left a comment
There was a problem hiding this comment.
Approved: PR has both lgtm and approved labels
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?