Add support for specific snapshot restoration and interactive mode#334
Add support for specific snapshot restoration and interactive mode#334shrutiyam-glitch wants to merge 17 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. |
|
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. |
This PR implements the next phase of the Pod Snapshot SDK integration for the PodSnapshotSandboxClient. It introduces two primary ways to control sandbox restoration: restoring from a specific
snapshot_uidand aninteractive_modethat allows users to select a snapshot from a filtered list of local metadata.Key changes:
-- Specific Snapshot UID: Added
snapshot_uidto thePodSnapshotSandboxClientconstructor. If provided, the client verifies the snapshot's "Ready" state and configures the SandboxClaim to restore from it.-- Interactive Mode: Added
interactive_mode. When enabled, the client prompts the user to select from a list of available snapshots that match the labels of the currentSandboxTemplateand client configuration.-- Template Label Fetching: The client retrieves default labels directly from the SandboxTemplate (via the sandboxtemplates custom object) to ensure snapshot filtering is consistent with the server-side configuration.
Label Merging: User-provided labels are merged with template labels to create a comprehensive set for snapshot matching.
-- Restoration Annotation: Implemented
_configure_snapshot_restorewhich adds thepodsnapshot.gke.io/ps-nameannotation to the client's internal annotations.-- SandboxClaim Manifest: Updated
_create_claimin the baseSandboxClientto correctly apply these annotations and labels to theSandboxClaimmetadata.Testing Done:
Integration Test: Added test_podsnapshot_extension.py which verifies the full E2E flow: