Add status method to Sandbox Client and also add unit tests associated with it.#280
Add status method to Sandbox Client and also add unit tests associated with it.#280SHRUTI6991 wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
Hi @SHRUTI6991. 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. |
|
/assign @barney-s |
|
/ok-to-test |
| return SandboxStatus.SANDBOX_NOT_CREATED | ||
|
|
||
| try: | ||
| v1 = client.CoreV1Api() |
There was a problem hiding this comment.
Could we move it outside of status() to reduce overhead?
| span.set_attribute("sandbox.name", self.claim_name) | ||
|
|
||
| if not self.claim_name: | ||
| return SandboxStatus.SANDBOX_NOT_CREATED |
There was a problem hiding this comment.
self.claim_name could be None when SandboxClient is initialized with api_url, so it's misleading to report SandboxNotCreated
There was a problem hiding this comment.
I am curious, wouldn't the __enter__ method initialize the claim_name with a different claim_name if only api_url is provided.
For this PR, I have removed this check and currently only calling the API to report the accurate status.
clients/python/agentic-sandbox-client/agentic_sandbox/sandbox_client.py
Outdated
Show resolved
Hide resolved
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aditya-shantanu, SHRUTI6991 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 |
|
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. |
| format='%(asctime)s - %(levelname)s - %(message)s', | ||
| stream=sys.stdout) | ||
|
|
||
| class SandboxStatus(Enum): |
There was a problem hiding this comment.
If i'm not mistaken, this PR will be affected by this one #121 , right ?
There was a problem hiding this comment.
Oh nice, we are exposing the Sandbox status directly. Yes let me hold on to my current PR.
|
@SHRUTI6991: 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. |
Description
This PR adds two changes:
statusmethod which returns theSandboxStatus. It internally calls the K8 API to check the status of the Pod.sandbox_client.Testing Logs