| 2034 | } |
| 2035 | |
| 2036 | fn build_binds( |
| 2037 | sandbox: &DriverSandbox, |
| 2038 | config: &DockerDriverRuntimeConfig, |
| 2039 | ) -> Result<Vec<String>, Status> { |
| 2040 | let mut binds = vec![format!( |
| 2041 | "{}:{}:ro,z", |
| 2042 | config.supervisor_bin.display(), |
| 2043 | SUPERVISOR_MOUNT_PATH |
| 2044 | )]; |
| 2045 | if let Some(tls) = &config.guest_tls { |
| 2046 | binds.push(format!("{}:{}:ro,z", tls.ca.display(), TLS_CA_MOUNT_PATH)); |
| 2047 | binds.push(format!( |
| 2048 | "{}:{}:ro,z", |
| 2049 | tls.cert.display(), |
| 2050 | TLS_CERT_MOUNT_PATH |
| 2051 | )); |
| 2052 | binds.push(format!("{}:{}:ro,z", tls.key.display(), TLS_KEY_MOUNT_PATH)); |
| 2053 | } |
| 2054 | if sandbox |
| 2055 | .spec |
| 2056 | .as_ref() |
| 2057 | .is_some_and(|spec| !spec.sandbox_token.is_empty()) |
| 2058 | { |
| 2059 | binds.push(format!( |
| 2060 | "{}:{}:ro,z", |
| 2061 | sandbox_token_host_path(sandbox, config)?.display(), |
| 2062 | SANDBOX_TOKEN_MOUNT_PATH |
| 2063 | )); |
| 2064 | } |
| 2065 | Ok(binds) |
| 2066 | } |
| 2067 | |
| 2068 | fn sandbox_token_host_path( |
| 2069 | sandbox: &DriverSandbox, |