MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / podman_socket_candidates_from_env

Function podman_socket_candidates_from_env

crates/openshell-core/src/config.rs:168–196  ·  view source on GitHub ↗
(
    socket: Option<PathBuf>,
    runtime_dir: Option<PathBuf>,
    home: Option<PathBuf>,
)

Source from the content-addressed store, hash-verified

166}
167
168fn podman_socket_candidates_from_env(
169 socket: Option<PathBuf>,
170 runtime_dir: Option<PathBuf>,
171 home: Option<PathBuf>,
172) -> Vec<PathBuf> {
173 let mut candidates = Vec::new();
174
175 if let Some(path) = socket {
176 candidates.push(path);
177 }
178
179 if let Some(runtime_dir) = runtime_dir {
180 candidates.push(runtime_dir.join("podman/podman.sock"));
181 }
182
183 #[cfg(target_os = "linux")]
184 {
185 candidates.push(PathBuf::from(format!(
186 "/run/user/{}/podman/podman.sock",
187 current_uid()
188 )));
189 }
190
191 if let Some(home) = home {
192 candidates.push(home.join(".local/share/containers/podman/machine/podman.sock"));
193 }
194
195 candidates
196}
197
198fn is_docker_available() -> bool {
199 is_binary_available("docker") || docker_socket_available()

Calls 1

pushMethod · 0.80