(
docker: &Docker,
docker_config: &DockerComputeConfig,
daemon_arch: &str,
)
| 3083 | } |
| 3084 | |
| 3085 | pub(crate) async fn resolve_supervisor_bin( |
| 3086 | docker: &Docker, |
| 3087 | docker_config: &DockerComputeConfig, |
| 3088 | daemon_arch: &str, |
| 3089 | ) -> CoreResult<PathBuf> { |
| 3090 | let current_exe = |
| 3091 | if cfg!(target_os = "linux") |
| 3092 | && docker_config.supervisor_bin.is_none() |
| 3093 | && docker_config.supervisor_image.is_none() |
| 3094 | { |
| 3095 | Some(std::env::current_exe().map_err(|err| { |
| 3096 | Error::config(format!("failed to resolve current executable: {err}")) |
| 3097 | })?) |
| 3098 | } else { |
| 3099 | None |
| 3100 | }; |
| 3101 | let target_candidates = linux_supervisor_candidates(daemon_arch); |
| 3102 | |
| 3103 | match resolve_supervisor_bin_source(docker_config, current_exe.as_deref(), &target_candidates)? |
| 3104 | { |
| 3105 | SupervisorBinSource::Binary(path) => Ok(path), |
| 3106 | SupervisorBinSource::Image(image) => { |
| 3107 | extract_supervisor_bin_from_image(docker, &image).await |
| 3108 | } |
| 3109 | } |
| 3110 | } |
| 3111 | |
| 3112 | fn linux_supervisor_candidates(daemon_arch: &str) -> Vec<PathBuf> { |
| 3113 | match daemon_arch { |
no test coverage detected