3
3
//! Wrapper for podman which writes to a bootc-owned root.
4
4
5
5
use std:: os:: unix:: process:: CommandExt ;
6
- use std:: path:: Path ;
7
6
8
7
use anyhow:: { anyhow, Result } ;
9
8
use camino:: { Utf8Path , Utf8PathBuf } ;
@@ -14,7 +13,6 @@ use serde::Deserialize;
14
13
use tokio:: process:: Command ;
15
14
16
15
use crate :: hostexec:: run_in_host_mountns;
17
- use crate :: ostree_authfile;
18
16
use crate :: spec:: ImageReference ;
19
17
use crate :: task:: Task ;
20
18
use crate :: utils:: { cmd_in_root, newline_trim_vec_to_string} ;
@@ -63,14 +61,15 @@ pub(crate) async fn podman_pull(
63
61
image : & ImageReference ,
64
62
quiet : bool ,
65
63
) -> 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) ;
67
66
let mut cmd = podman_in_root ( rootfs) ?;
68
67
let image = OstreeImageReference :: from ( image. clone ( ) ) ;
69
68
let pull_spec_image = image. imgref . to_string ( ) ;
70
69
tracing:: debug!( "Pulling {pull_spec_image}" ) ;
71
70
let child = cmd
72
71
. args ( [ "pull" ] )
73
- . args ( authfile. iter ( ) . flat_map ( |v| [ Path :: new ( "--authfile" ) , v] ) )
72
+ . args ( authfile. iter ( ) . flat_map ( |v| [ "--authfile" , v. as_str ( ) ] ) )
74
73
. args ( quiet. then_some ( "--quiet" ) )
75
74
. arg ( & pull_spec_image)
76
75
. stdout ( std:: process:: Stdio :: piped ( ) )
0 commit comments