feat: implement pod snapshot method#339
feat: implement pod snapshot method#339shrutiyam-glitch wants to merge 3 commits intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shrutiyam-glitch 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 |
|
Hi @shrutiyam-glitch. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Depends on: #338 #337
This PR completes the Pod Snapshot extension for the Python SDK by implementing the
snapshot()method and the underlying logic to monitor snapshot completion.Core Logic Implementation:
snapshot()method creates aPodSnapshotManualTriggerresource for the target pod, using a unique hash suffix to avoid name collisions._wait_for_snapshot_processed, which uses the Kubernetes watch API to block until the snapshot controller marks the trigger asComplete. It specifically looks for the Triggered condition with aTruestatus andCompletereason.snapshot_uidfrom the resource status and returns a structuredSnapshotResponse, providing the user with the unique identifier needed for future restores.__exit__method to ensure that allPodSnapshotManualTriggerresources created during the session are automatically deleted, maintaining a clean namespace.Testing Done:
Integration Test: Added
test_podsnapshot_extension.pywhich verifies the full E2E flow:-- Starts a sandbox with a counter application.
-- Creates two sequential snapshots (test-snapshot-10 at 10 seconds and test-snapshot-20 at 20 seconds).
Unit tests are added
Output: