feat(python-sdk): add SandboxInClusterConnectionConfig to bypass router#489
feat(python-sdk): add SandboxInClusterConnectionConfig to bypass router#489vgunapati wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vgunapati 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 |
✅ Deploy Preview for agent-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Welcome @vgunapati! |
|
Hi @vgunapati. 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 Regular contributors should join the org to skip this step. 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. |
clients/python/agentic-sandbox-client/k8s_agent_sandbox/sandbox_client.py
Outdated
Show resolved
Hide resolved
3c5b8ec to
ce8e4c8
Compare
ce8e4c8 to
968d150
Compare
clients/python/agentic-sandbox-client/k8s_agent_sandbox/test/unit/test_sandbox_client.py
Outdated
Show resolved
Hide resolved
|
/ok-to-test |
964491f to
7b8f20a
Compare
7b8f20a to
e00b667
Compare
| f"Stderr: {stderr.decode(errors='replace')}" | ||
| ) | ||
|
|
||
| class InClusterConnectionStrategy(ConnectionStrategy): |
e00b667 to
8ad07a4
Compare
Summary
SandboxInClusterConnectionConfigtomodels.pyfor direct in-cluster connectivity to sandbox pods, bypassing the sandbox router entirelyhttp://{sandbox_id}.{namespace}.svc.cluster.local:{server_port}directly from the sandbox identityInClusterConnectionStrategytoconnector.pywhich suppresses router-specific headers (X-Sandbox-ID,X-Sandbox-Namespace,X-Sandbox-Port) since requests go directly to the podSandboxClientfactory via theconnection_configparameterUsage
Test Plan
cd clients/python/agentic-sandbox-client && pytest k8s_agent_sandbox/test/ sandbox-router/test_sandbox_router.py— 62 passedTestInClusterConnectionStrategy— DNS URL construction, header suppression, idempotencyTestExistingStrategiesDefaultHeaderInjection— regression: existing strategies unaffectedTestSandboxConnectorStrategySelection— in-cluster strategy selected forSandboxInClusterConnectionConfigTestSandboxConnectorHeaderInjection— router headers suppressed for in-cluster, present otherwiseTestSandboxClientInClusterConfig— config stored correctly, propagated to createdSandboxhandlesTestSandboxClient— regression: existing factory behaviour unaffected