Skip to content

Commit ec59a16

Browse files
authored
Merge pull request #275 from cgwalters/unshare-idempotent
install: Don't unshare if we have an external source
2 parents ac52673 + eb620cc commit ec59a16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ async fn prepare_install(
953953
let rootfs = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())
954954
.context("Opening /")?;
955955

956+
let external_source = source_opts.source_imgref.is_some();
956957
let source = match source_opts.source_imgref {
957958
None => {
958959
let container_info = crate::containerenv::get_container_execution_info(&rootfs)?;
@@ -1004,7 +1005,7 @@ async fn prepare_install(
10041005

10051006
// Even though we require running in a container, the mounts we create should be specific
10061007
// to this process, so let's enter a private mountns to avoid leaking them.
1007-
if std::env::var_os("BOOTC_SKIP_UNSHARE").is_none() {
1008+
if !external_source && std::env::var_os("BOOTC_SKIP_UNSHARE").is_none() {
10081009
super::cli::ensure_self_unshared_mount_namespace().await?;
10091010
}
10101011

0 commit comments

Comments
 (0)