Skip to content

Commit 99bbed4

Browse files
fix(e2e): pass the host gateway IP to the external Kubernetes driver
The external-driver lane renders server.hostGatewayIP, but only the in-process driver reads it from the gateway TOML. The standalone driver takes OPENSHELL_HOST_GATEWAY_IP, which the post-renderer never set, so sandbox policy DNS refused host.openshell.internal on that lane. Copy the chart's rendered value into the driver container when present. Signed-off-by: Matthew Grossman <[email protected]>
1 parent 566b39d commit 99bbed4

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: apps/v1
5+
kind: StatefulSet
6+
metadata:
7+
name: openshell
8+
spec:
9+
template:
10+
spec:
11+
containers:
12+
- name: kubernetes-compute-driver
13+
env:
14+
- name: OPENSHELL_HOST_GATEWAY_IP
15+
value: replaced-by-kustomize
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# The in-process driver reads server.hostGatewayIP from the rendered gateway
5+
# TOML. The external driver reads it from its own environment, so copy the
6+
# chart's rendered value into that container.
7+
apiVersion: kustomize.config.k8s.io/v1alpha1
8+
kind: Component
9+
patches:
10+
- path: driver-env-patch.yaml
11+
target:
12+
group: apps
13+
version: v1
14+
kind: StatefulSet
15+
name: openshell
16+
replacements:
17+
- source:
18+
group: apps
19+
version: v1
20+
kind: StatefulSet
21+
name: openshell
22+
fieldPath: spec.template.spec.hostAliases.0.ip
23+
targets:
24+
- select:
25+
group: apps
26+
version: v1
27+
kind: StatefulSet
28+
name: openshell
29+
fieldPaths:
30+
- spec.template.spec.containers.[name=kubernetes-compute-driver].env.[name=OPENSHELL_HOST_GATEWAY_IP].value

‎e2e/helm-plugins/openshell-external-compute-driver/post-renderer.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ cp "${plugin_dir}/kustomization.yaml" "${work_dir}/kustomization.yaml"
1616
cp "${plugin_dir}/workload-patch.yaml" "${work_dir}/workload-patch.yaml"
1717
tee "${work_dir}/rendered.yaml" >/dev/null
1818

19+
# server.hostGatewayIP renders the gateway pod's hostAliases entry.
20+
if grep -q 'host\.openshell\.internal' "${work_dir}/rendered.yaml" \
21+
&& grep -q '^ *hostAliases:' "${work_dir}/rendered.yaml"; then
22+
cp -R "${plugin_dir}/host-gateway" "${work_dir}/host-gateway"
23+
printf 'components:\n - host-gateway\n' >>"${work_dir}/kustomization.yaml"
24+
fi
25+
1926
kubectl kustomize "${work_dir}"

0 commit comments

Comments
 (0)