Skip to main content

build_guest_wrapper

Function build_guest_wrapper 

Source
pub fn build_guest_wrapper(
    req: &ExecRequest,
    add_dir_labels: &[String],
) -> String
Expand description

Build the wrapper script that runs inside the guest:

  1. mounts each --add-dir ext4 image read-only by label
  2. exports launch-plan-derived env vars (when target is LaunchPlan)
  3. exports CLI --env vars (CLI overrides launch-plan)
  4. cds into working_dir (when target is LaunchPlan and it’s set)
  5. execs the resolved command

add_dir_labels is the parallel list of ext4 labels assigned to each AddDir (in the same order as req.add_dirs).

Env precedence (lowest β†’ highest): launch-plan app.env β†’ launch-plan entrypoint.env β†’ CLI --env. The first two are merged in parse_launch_plan; CLI wins by being emitted last.