Skip to content

Commit 0810201

Browse files
committed
feat(sidecar): support SIDECAR_PASSTHROUGH_KEYS for env forwarding
1 parent 3a511be commit 0810201

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

oss-crs-infra/builder-sidecar/docker_ops.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ def _resource_kwargs(cpuset: "str | None", mem_limit: "str | None") -> dict:
4747

4848

4949
def _oss_fuzz_env() -> dict[str, str]:
50-
"""Forward OSS-Fuzz env vars from the sidecar into ephemeral containers."""
51-
return {k: v for k in _OSS_FUZZ_ENV_KEYS if (v := os.environ.get(k)) is not None}
50+
"""Forward OSS-Fuzz env vars and additional passthrough keys to ephemeral containers."""
51+
result = {k: v for k in _OSS_FUZZ_ENV_KEYS if (v := os.environ.get(k)) is not None}
52+
# Forward additional keys specified by SIDECAR_PASSTHROUGH_KEYS (comma-separated)
53+
passthrough = os.environ.get("SIDECAR_PASSTHROUGH_KEYS", "")
54+
if passthrough:
55+
for key in passthrough.split(","):
56+
key = key.strip()
57+
if key and (val := os.environ.get(key)) is not None:
58+
result[key] = val
59+
return result
5260

5361

5462
def _incremental_build_enabled() -> bool:

0 commit comments

Comments
 (0)