Creates a tar archive from a directory
(&self, dir_path: &Path)
| 713 | |
| 714 | /// Creates a tar archive from a directory |
| 715 | fn create_tar_archive_from_directory(&self, dir_path: &Path) -> Result<Vec<u8>> { |
| 716 | use tar::Builder; |
| 717 | |
| 718 | let mut tar_data = Vec::new(); |
| 719 | { |
| 720 | let mut builder = Builder::new(&mut tar_data); |
| 721 | |
| 722 | // Add all files from the directory to the tar archive |
| 723 | builder.append_dir_all(".", dir_path)?; |
| 724 | |
| 725 | builder.finish()?; |
| 726 | } |
| 727 | |
| 728 | Ok(tar_data) |
| 729 | } |
| 730 | |
| 731 | /// Creates an internal network for a specific agent container. |
| 732 | /// |