Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy symlinks for host dependencies #54

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions podman-pilot/src/podman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ fn run_podman_creation(

// lookup and sync host dependencies from systemfiles data
let mut ignore_missing = false;
let mut copy_links = true;
let system_files = tempfile()?;
if let Ok(systemfiles) = has_system_dependencies(
&instance_mount_point, &system_files
Expand All @@ -329,7 +330,8 @@ fn run_podman_creation(
}
match sync_host(
&instance_mount_point, &system_files,
root_user, ignore_missing, defaults::SYSTEM_HOST_DEPENDENCIES
root_user, ignore_missing, copy_links,
defaults::SYSTEM_HOST_DEPENDENCIES
) {
Ok(_) => { },
Err(error) => {
Expand All @@ -344,11 +346,13 @@ fn run_podman_creation(
// lookup and sync host dependencies from removed data
if provisioning_failed.is_none() {
ignore_missing = true;
copy_links = false;
let removed_files = tempfile()?;
update_removed_files(&instance_mount_point, &removed_files)?;
sync_host(
&instance_mount_point, &removed_files,
root_user, ignore_missing, defaults::HOST_DEPENDENCIES
root_user, ignore_missing, copy_links,
defaults::HOST_DEPENDENCIES
)?;
}

Expand Down Expand Up @@ -390,7 +394,8 @@ fn run_podman_creation(
}
sync_host(
&instance_mount_point, &removed_files,
root_user, ignore_missing, defaults::HOST_DEPENDENCIES
root_user, ignore_missing, copy_links,
defaults::HOST_DEPENDENCIES
)?;
}

Expand Down Expand Up @@ -566,7 +571,7 @@ pub fn umount_container(

pub fn sync_host(
target: &String, mut removed_files: &File, user: User,
ignore_missing: bool, from: &str
ignore_missing: bool, copy_links: bool, from: &str
) -> Result<(), FlakeError> {
/*!
Sync files/dirs specified in target/from, from the running
Expand All @@ -588,6 +593,9 @@ pub fn sync_host(

let mut call = user.run("rsync");
call.arg("-av");
if copy_links {
call.arg("--copy-links");
}
if ignore_missing {
call.arg("--ignore-missing-args");
}
Expand Down
Loading