(
format: &ExportFormat,
target_path: &Utf8Path,
output_path: Option<&Utf8Path>,
kernel_in_boot: bool,
disable_selinux: bool,
)
| 28 | /// Export a container filesystem to tar format with bootc-specific features. |
| 29 | #[context("Exporting container")] |
| 30 | pub(crate) async fn export( |
| 31 | format: &ExportFormat, |
| 32 | target_path: &Utf8Path, |
| 33 | output_path: Option<&Utf8Path>, |
| 34 | kernel_in_boot: bool, |
| 35 | disable_selinux: bool, |
| 36 | ) -> Result<()> { |
| 37 | use cap_std_ext::cap_std; |
| 38 | use cap_std_ext::cap_std::fs::Dir; |
| 39 | |
| 40 | let options = ExportOptions { |
| 41 | kernel_in_boot, |
| 42 | disable_selinux, |
| 43 | }; |
| 44 | |
| 45 | let root_dir = Dir::open_ambient_dir(target_path, cap_std::ambient_authority()) |
| 46 | .with_context(|| format!("Failed to open directory: {}", target_path))?; |
| 47 | |
| 48 | match format { |
| 49 | ExportFormat::Tar => export_tar(&root_dir, output_path, &options).await, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /// Export container filesystem as tar archive. |
| 54 | #[context("Exporting to tar")] |
no test coverage detected