Enhanced Pod Snapshot Management (Persistence, List, Delete)#312
Enhanced Pod Snapshot Management (Persistence, List, Delete)#312shrutiyam-glitch wants to merge 16 commits intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for agent-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[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. |
|
@shrutiyam-glitch: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
|
PR needs rebase. 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. |
Depends on: #249
This PR extends the
PodSnapshotSandboxClientto support the full lifecycle of pod snapshots, introducing local metadata persistence, listing capabilities, and deletion logic.Key Changes:
Snapshot Persistence (SnapshotPersistenceManager):-- Added local metadata storage (
~/.snapshot_metadata/.snapshots.json) to track created snapshots.-- Metadata includes
snapshot_uid,creationTimestamp,policy_labels,policy_nameand claim_name.-- The
snapshot()method now automatically saves snapshot metadata upon successful creation.list_snapshots():-- Lists valid snapshots from local metadata. Supports filtering by
policy_nameandready_onlystatus.-- Returns a list of dictionaries sorted by creation timestamp (newest first).
delete_snapshots():-- Deletes both the
PodSnapshotresources from the cluster.-- Cleans up the corresponding local metadata.
-- Returns the total count of successfully deleted snapshots.
-- Can delete a specific snapshot by
snapshot_uidor ALL tracked snapshots if no name is provided.Helper Methods:
_get_policy_infoto fetch labels from thePodSnapshotandPodSnapshotPolicyresources for metadata storage.Testing:
Unit Tests: Added
agentic_sandbox/gke_extensions/test_podsnapshot_client.pyIntegration Test:
-- Updated
test_podsnapshot_extension.pyto verify the new listing and deletion workflows.-- Lists existing ready snapshots after creation.
-- Deletes all snapshots at the end of the test and verifies the deletion count.
Output: