You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debug output confirms the environment variables are correctly serialized in the protobuf message (request.spec.template.environment contains these values)
After the sandbox is ready, run env inside the sandbox:
env | grep GATEWAY
# no output - environment variables are missing
Expected Behavior
Environment variables in template.environment should appear in the container's environment.
Actual Behavior
Debug output confirms template.environment is correctly passed to the OpenShell server
But running env shows no custom environment variables
OpenShell default environment variables (like OPENSHELL_SANDBOX_ID, SSL_CERT_FILE, etc.) do appear
Verification Steps Taken
prost protobuf serialization is correct: request.spec.template.environment contains all environment variables
Rust build_env_list function should process template_environment: it calls apply_env_map(&mut env, template_environment)
apply_env_map should upsert environment variables
Tested with a simple MY_TEST_VAR=test_value - same result, environment variable not present
Environment
OpenShell version: 0.0.29 (running k3s on OrbStack)
Problem Description
When passing custom environment variables via
SandboxSpec.template.environment, these variables do not appear in the sandbox container's environment.Reproduction Steps
Debug output confirms the environment variables are correctly serialized in the protobuf message (
request.spec.template.environmentcontains these values)After the sandbox is ready, run
envinside the sandbox:Expected Behavior
Environment variables in
template.environmentshould appear in the container's environment.Actual Behavior
template.environmentis correctly passed to the OpenShell serverenvshows no custom environment variablesOPENSHELL_SANDBOX_ID,SSL_CERT_FILE, etc.) do appearVerification Steps Taken
request.spec.template.environmentcontains all environment variablesbuild_env_listfunction should processtemplate_environment: it callsapply_env_map(&mut env, template_environment)apply_env_mapshould upsert environment variablesMY_TEST_VAR=test_value- same result, environment variable not presentEnvironment
OPENSHELL_SANDBOX_COMMANDvia theenvironmentmap and it didn't workRelated Code
crates/openshell-server/src/sandbox/mod.rs:sandbox_template_to_k8sreceivestemplate_environment: &HashMap<String, String>build_env_listcallsapply_env_map(&mut env, template_environment)apply_env_mapshould upsert environment variablesPossible Causes
map<string, string>fieldstemplate.environmentsupport was never fully implementedRelated issues: #848 (similar environment variable issue)