File tree Expand file tree Collapse file tree
crates/openshell-driver-vm/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1557,25 +1557,23 @@ fn parse_registry_reference(image_ref: &str) -> Result<Reference, Status> {
15571557/// `DOCKER_HOST`). If Docker is unavailable, falls back to the Podman
15581558/// socket, which exposes a Docker-compatible API.
15591559async fn connect_local_container_engine ( ) -> Option < Docker > {
1560- if let Ok ( docker) = Docker :: connect_with_local_defaults ( ) {
1561- if docker. ping ( ) . await . is_ok ( ) {
1562- return Some ( docker ) ;
1563- }
1560+ if let Ok ( docker) = Docker :: connect_with_local_defaults ( )
1561+ && docker. ping ( ) . await . is_ok ( )
1562+ {
1563+ return Some ( docker ) ;
15641564 }
15651565
15661566 let podman_socket = podman_socket_path ( ) ;
1567- if podman_socket. exists ( ) {
1568- if let Ok ( docker) =
1567+ if podman_socket. exists ( )
1568+ && let Ok ( docker) =
15691569 Docker :: connect_with_unix ( podman_socket. to_str ( ) ?, 120 , bollard:: API_DEFAULT_VERSION )
1570- {
1571- if docker. ping ( ) . await . is_ok ( ) {
1572- info ! (
1573- socket = %podman_socket. display( ) ,
1574- "vm driver: connected to Podman (Docker-compatible API)"
1575- ) ;
1576- return Some ( docker) ;
1577- }
1578- }
1570+ && docker. ping ( ) . await . is_ok ( )
1571+ {
1572+ info ! (
1573+ socket = %podman_socket. display( ) ,
1574+ "vm driver: connected to Podman (Docker-compatible API)"
1575+ ) ;
1576+ return Some ( docker) ;
15791577 }
15801578
15811579 None
You can’t perform that action at this time.
0 commit comments