@@ -203,6 +203,8 @@ pub(crate) struct State {
203
203
pub ( crate ) source : SourceInfo ,
204
204
/// Force SELinux off in target system
205
205
pub ( crate ) override_disable_selinux : bool ,
206
+ /// True if the skoepo on host supports containers-storage:
207
+ pub ( crate ) skopeo_supports_containers_storage : bool ,
206
208
#[ allow( dead_code) ]
207
209
pub ( crate ) setenforce_guard : Option < crate :: lsm:: SetEnforceGuard > ,
208
210
pub ( crate ) config_opts : InstallConfigOpts ,
@@ -501,7 +503,7 @@ async fn initialize_ostree_root_from_self(
501
503
} ;
502
504
503
505
let mut temporary_dir = None ;
504
- let src_imageref = if skopeo_supports_containers_storage ( ) ? {
506
+ let src_imageref = if state . skopeo_supports_containers_storage {
505
507
// We always use exactly the digest of the running image to ensure predictability.
506
508
let spec =
507
509
crate :: utils:: digested_pullspec ( & state. source . imageref . name , & state. source . digest ) ;
@@ -792,6 +794,9 @@ async fn prepare_install(
792
794
anyhow:: bail!( "Cannot install from rootless podman; this command must be run as root" ) ;
793
795
}
794
796
797
+ let skopeo_supports_containers_storage = skopeo_supports_containers_storage ( )
798
+ . context ( "Failed to run skopeo (it currently must be installed in the host root)" ) ?;
799
+
795
800
let source = SourceInfo :: from_container ( & container_info) ?;
796
801
797
802
ensure_var ( ) ?;
@@ -815,6 +820,7 @@ async fn prepare_install(
815
820
// combines our command line options along with some bind mounts from the host.
816
821
let state = Arc :: new ( State {
817
822
override_disable_selinux,
823
+ skopeo_supports_containers_storage,
818
824
setenforce_guard,
819
825
source,
820
826
config_opts,
0 commit comments