Description
In PR #910, the Go SDK was updated to automatically and unconditionally inject the X-Sandbox-Pod-IP header in SendRequest whenever a Pod IP is resolved and populated. While this is a highly pragmatic default that resolves 502 bad gateway errors in standard deployments without cluster DNS, it can cause routing issues in environments with strict network policies, service meshes, or secure overlays where direct pod-to-pod IP communication is restricted but service-based DNS routing is required.
In the Python SDK, direct Pod IP routing can be explicitly toggled on or off via the use_pod_ip: bool option inside SandboxInClusterConnectionConfig.
Proposed Changes
- Add a configuration option/toggle (e.g.
UsePodIP or DisablePodIPRouting field) to the Go SDK's connection/client configuration.
- Update the
SendRequest implementation in the connector to respect this flag, omitting the X-Sandbox-Pod-IP header when the option is disabled.
- Update relevant documentation and add unit tests to verify header injection behaves according to the configuration toggle.
Description
In PR #910, the Go SDK was updated to automatically and unconditionally inject the
X-Sandbox-Pod-IPheader inSendRequestwhenever a Pod IP is resolved and populated. While this is a highly pragmatic default that resolves 502 bad gateway errors in standard deployments without cluster DNS, it can cause routing issues in environments with strict network policies, service meshes, or secure overlays where direct pod-to-pod IP communication is restricted but service-based DNS routing is required.In the Python SDK, direct Pod IP routing can be explicitly toggled on or off via the
use_pod_ip: booloption insideSandboxInClusterConnectionConfig.Proposed Changes
UsePodIPorDisablePodIPRoutingfield) to the Go SDK's connection/client configuration.SendRequestimplementation in the connector to respect this flag, omitting theX-Sandbox-Pod-IPheader when the option is disabled.