@@ -1120,11 +1120,12 @@ pub(crate) fn setup_sys_mount(fstype: &str, fspath: &str) -> Result<()> {
1120
1120
1121
1121
/// Verify that we can load the manifest of the target image
1122
1122
#[ context( "Verifying fetch" ) ]
1123
- async fn verify_target_fetch ( imgref : & ostree_container:: OstreeImageReference ) -> Result < ( ) > {
1124
- let tmpdir = tempfile:: tempdir ( ) ?;
1125
- let tmprepo = & ostree:: Repo :: new_for_path ( tmpdir. path ( ) ) ;
1126
- tmprepo
1127
- . create ( ostree:: RepoMode :: Bare , ostree:: gio:: Cancellable :: NONE )
1123
+ async fn verify_target_fetch (
1124
+ tmpdir : & Dir ,
1125
+ imgref : & ostree_container:: OstreeImageReference ,
1126
+ ) -> Result < ( ) > {
1127
+ let tmpdir = & TempDir :: new_in ( & tmpdir) ?;
1128
+ let tmprepo = & ostree:: Repo :: create_at_dir ( tmpdir. as_fd ( ) , "." , ostree:: RepoMode :: Bare , None )
1128
1129
. context ( "Init tmp repo" ) ?;
1129
1130
1130
1131
tracing:: trace!( "Verifying fetch for {imgref}" ) ;
@@ -1207,10 +1208,6 @@ async fn prepare_install(
1207
1208
} ;
1208
1209
tracing:: debug!( "Target image reference: {target_imgref}" ) ;
1209
1210
1210
- if !target_opts. skip_fetch_check {
1211
- verify_target_fetch ( & target_imgref) . await ?;
1212
- }
1213
-
1214
1211
// A bit of basic global state setup
1215
1212
ensure_var ( ) ?;
1216
1213
setup_tmp_mounts ( ) ?;
@@ -1220,6 +1217,10 @@ async fn prepare_install(
1220
1217
// And continue to init global state
1221
1218
ensure_writable_etc_containers ( & tempdir) ?;
1222
1219
1220
+ if !target_opts. skip_fetch_check {
1221
+ verify_target_fetch ( & tempdir, & target_imgref) . await ?;
1222
+ }
1223
+
1223
1224
// Even though we require running in a container, the mounts we create should be specific
1224
1225
// to this process, so let's enter a private mountns to avoid leaking them.
1225
1226
if !external_source && std:: env:: var_os ( "BOOTC_SKIP_UNSHARE" ) . is_none ( ) {
0 commit comments