33//! Wrapper for podman which writes to a bootc-owned root.
44
55use std:: os:: unix:: process:: CommandExt ;
6- use std:: path:: Path ;
76
87use anyhow:: { anyhow, Result } ;
98use camino:: { Utf8Path , Utf8PathBuf } ;
@@ -14,7 +13,6 @@ use serde::Deserialize;
1413use tokio:: process:: Command ;
1514
1615use crate :: hostexec:: run_in_host_mountns;
17- use crate :: ostree_authfile;
1816use crate :: spec:: ImageReference ;
1917use crate :: task:: Task ;
2018use crate :: utils:: { cmd_in_root, newline_trim_vec_to_string} ;
@@ -63,14 +61,15 @@ pub(crate) async fn podman_pull(
6361 image : & ImageReference ,
6462 quiet : bool ,
6563) -> Result < String > {
66- let authfile = ostree_authfile:: get_global_authfile_path ( ) ?;
64+ let authfile =
65+ ostree_ext:: globals:: get_global_authfile ( rootfs) ?. map ( |( authfile, _fd) | authfile) ;
6766 let mut cmd = podman_in_root ( rootfs) ?;
6867 let image = OstreeImageReference :: from ( image. clone ( ) ) ;
6968 let pull_spec_image = image. imgref . to_string ( ) ;
7069 tracing:: debug!( "Pulling {pull_spec_image}" ) ;
7170 let child = cmd
7271 . args ( [ "pull" ] )
73- . args ( authfile. iter ( ) . flat_map ( |v| [ Path :: new ( "--authfile" ) , v] ) )
72+ . args ( authfile. iter ( ) . flat_map ( |v| [ "--authfile" , v. as_str ( ) ] ) )
7473 . args ( quiet. then_some ( "--quiet" ) )
7574 . arg ( & pull_spec_image)
7675 . stdout ( std:: process:: Stdio :: piped ( ) )
0 commit comments