Skip to content

Commit f9d1454

Browse files
jhjaggarsrussellb
authored andcommitted
fix(kubernetes): preserve proxy URL for exec sessions
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
1 parent 8d70aa8 commit f9d1454

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • crates/openshell-driver-kubernetes/src

‎crates/openshell-driver-kubernetes/src/driver.rs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4734,6 +4734,9 @@ fn apply_supervisor_proxy_pod_topology(
47344734
// proxy variables; the supervisor's own gateway dial is a direct
47354735
// gRPC channel that does not consult them.
47364736
let proxy_url = proxy_pod_proxy_url(&service_dns);
4737+
// The process supervisor clears relay-spawned child environments
4738+
// and reconstructs proxy variables from this canonical URL.
4739+
upsert_env(env, openshell_core::sandbox_env::PROXY_URL, &proxy_url);
47374740
for name in [
47384741
"ALL_PROXY",
47394742
"HTTP_PROXY",
@@ -9173,10 +9176,14 @@ mod tests {
91739176
Some("proxy-pod")
91749177
);
91759178
// The workload's children still egress through the remote proxy Service.
9179+
// Relay-spawned exec processes reconstruct their proxy variables from
9180+
// PROXY_URL after clearing the inherited supervisor environment.
9181+
let proxy_url = format!("http://{service_dns}:3128");
91769182
assert_eq!(
9177-
rendered_env(agent, "HTTP_PROXY"),
9178-
Some(format!("http://{service_dns}:3128").as_str())
9183+
rendered_env(agent, openshell_core::sandbox_env::PROXY_URL),
9184+
Some(proxy_url.as_str())
91799185
);
9186+
assert_eq!(rendered_env(agent, "HTTP_PROXY"), Some(proxy_url.as_str()));
91809187
assert_eq!(
91819188
rendered_env(agent, "SSL_CERT_FILE"),
91829189
Some("/etc/openshell-tls/proxy/ca-bundle.pem")

0 commit comments

Comments
 (0)