Skip to content

feat: add async pod snapshot support to Python SDK#563

Open
AndyJCai wants to merge 1 commit intokubernetes-sigs:mainfrom
AndyJCai:feat/async-pod-snapshots
Open

feat: add async pod snapshot support to Python SDK#563
AndyJCai wants to merge 1 commit intokubernetes-sigs:mainfrom
AndyJCai:feat/async-pod-snapshots

Conversation

@AndyJCai
Copy link
Copy Markdown
Contributor

@AndyJCai AndyJCai commented Apr 9, 2026

Summary

Ports GKE Pod Snapshot capabilities from the sync client (PodSnapshotSandboxClient) to the async SDK:

  • AsyncSnapshotEngine — async create, list, delete, delete_all, delete_manual_triggers
  • AsyncSandboxWithSnapshotSupport — async suspend(), resume(), is_suspended(), is_restored_from_snapshot(), terminate()
  • AsyncPodSnapshotSandboxClient — subclass of AsyncSandboxClient with lazy CRD verification via asyncio.Lock
  • Async utilities — watch/wait helpers using kubernetes_asyncio with proper await w.close() cleanup

Also fixes:

  • Pod name cache staleness on resume (sync + async) — new _resolve_pod_name() bypasses cache during polling
  • False-positive termination when pod UID is None
  • Resource leak if __aenter__ CRD check fails

Port GKE Pod Snapshot capabilities from the sync client to the async SDK:
- AsyncSnapshotEngine with create/list/delete/delete_all operations
- AsyncSandboxWithSnapshotSupport with suspend/resume/is_suspended
- AsyncPodSnapshotSandboxClient with lazy CRD verification
- Async utility functions for watch/wait operations
- Fix pod name cache staleness on resume (sync + async)

Made-with: Cursor
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AndyJCai
Once this PR has been reviewed and has the lgtm label, please assign igooch for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit 984b6ff
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/69d8101f583cc80008ff07a2

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 9, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @AndyJCai. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants