diff --git a/process/drivers.rs b/process/drivers.rs index 1469e25..e50d3ea 100644 --- a/process/drivers.rs +++ b/process/drivers.rs @@ -24,9 +24,9 @@ use miette::{miette, IntoDiagnostic, Result}; use oci_distribution::Reference; use once_cell::sync::Lazy; use opts::{ - BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, ContainerOpts, CreateContainerOpts, - GenerateImageNameOpts, GenerateKeyPairOpts, GenerateTagsOpts, GetMetadataOpts, PushOpts, - RemoveContainerOpts, RemoveImageOpts, RunOpts, SignOpts, TagOpts, VerifyOpts, VolumeOpts, + BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, CreateContainerOpts, GenerateImageNameOpts, + GenerateKeyPairOpts, GenerateTagsOpts, GetMetadataOpts, PushOpts, RemoveContainerOpts, + RemoveImageOpts, RunOpts, SignOpts, TagOpts, VerifyOpts, }; use types::{ BuildDriverType, CiDriverType, DetermineDriver, ImageMetadata, InspectDriverType, Platform, @@ -474,15 +474,15 @@ impl CiDriver for Driver { #[cfg(feature = "rechunk")] impl ContainerMountDriver for Driver { - fn mount_container(opts: &ContainerOpts) -> Result { + fn mount_container(opts: &opts::ContainerOpts) -> Result { PodmanDriver::mount_container(opts) } - fn unmount_container(opts: &ContainerOpts) -> Result<()> { + fn unmount_container(opts: &opts::ContainerOpts) -> Result<()> { PodmanDriver::unmount_container(opts) } - fn remove_volume(opts: &VolumeOpts) -> Result<()> { + fn remove_volume(opts: &opts::VolumeOpts) -> Result<()> { PodmanDriver::remove_volume(opts) } } diff --git a/process/drivers/podman_driver.rs b/process/drivers/podman_driver.rs index c40e6d6..5571f22 100644 --- a/process/drivers/podman_driver.rs +++ b/process/drivers/podman_driver.rs @@ -30,7 +30,7 @@ use crate::{ }; use super::{ - opts::{ContainerOpts, CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts, VolumeOpts}, + opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts}, types::ContainerId, }; #[cfg(feature = "rechunk")] @@ -374,7 +374,7 @@ fn get_metadata_cache(opts: &GetMetadataOpts) -> Result { #[cfg(feature = "rechunk")] impl ContainerMountDriver for PodmanDriver { - fn mount_container(opts: &ContainerOpts) -> Result { + fn mount_container(opts: &super::opts::ContainerOpts) -> Result { let use_sudo = opts.privileged && !running_as_root(); let output = { let c = cmd!( @@ -403,7 +403,7 @@ impl ContainerMountDriver for PodmanDriver { )) } - fn unmount_container(opts: &ContainerOpts) -> Result<()> { + fn unmount_container(opts: &super::opts::ContainerOpts) -> Result<()> { let use_sudo = opts.privileged && !running_as_root(); let output = { let c = cmd!( @@ -430,7 +430,7 @@ impl ContainerMountDriver for PodmanDriver { Ok(()) } - fn remove_volume(opts: &VolumeOpts) -> Result<()> { + fn remove_volume(opts: &super::opts::VolumeOpts) -> Result<()> { let use_sudo = opts.privileged && !running_as_root(); let output = { let c = cmd!( diff --git a/process/drivers/traits.rs b/process/drivers/traits.rs index dd7432c..ecf30d4 100644 --- a/process/drivers/traits.rs +++ b/process/drivers/traits.rs @@ -22,10 +22,9 @@ use super::{ gitlab_driver::GitlabDriver, local_driver::LocalDriver, opts::{ - BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, ContainerOpts, CreateContainerOpts, - GenerateImageNameOpts, GenerateKeyPairOpts, GenerateTagsOpts, GetMetadataOpts, PushOpts, - RemoveContainerOpts, RemoveImageOpts, RunOpts, SignOpts, SignVerifyOpts, TagOpts, - VerifyOpts, VerifyType, VolumeOpts, + BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, CreateContainerOpts, GenerateImageNameOpts, + GenerateKeyPairOpts, GenerateTagsOpts, GetMetadataOpts, PushOpts, RemoveContainerOpts, + RemoveImageOpts, RunOpts, SignOpts, SignVerifyOpts, TagOpts, VerifyOpts, VerifyType, }, podman_driver::PodmanDriver, skopeo_driver::SkopeoDriver, @@ -247,19 +246,19 @@ pub(super) trait ContainerMountDriver: PrivateDriver { /// /// # Errors /// Will error if the container mount command fails. - fn mount_container(opts: &ContainerOpts) -> Result; + fn mount_container(opts: &super::opts::ContainerOpts) -> Result; /// Unmount the container /// /// # Errors /// Will error if the container unmount command fails. - fn unmount_container(opts: &ContainerOpts) -> Result<()>; + fn unmount_container(opts: &super::opts::ContainerOpts) -> Result<()>; /// Remove a volume /// /// # Errors /// Will error if the volume remove command fails. - fn remove_volume(opts: &VolumeOpts) -> Result<()>; + fn remove_volume(opts: &super::opts::VolumeOpts) -> Result<()>; } #[cfg(feature = "rechunk")] @@ -309,7 +308,7 @@ pub trait RechunkDriver: RunDriver + BuildDriver + ContainerMountDriver { .build(), )?; let mount = &Self::mount_container( - &ContainerOpts::builder() + &super::opts::ContainerOpts::builder() .container_id(container) .privileged(true) .build(), @@ -379,7 +378,7 @@ pub trait RechunkDriver: RunDriver + BuildDriver + ContainerMountDriver { if !status.success() { Self::unmount_container( - &ContainerOpts::builder() + &super::opts::ContainerOpts::builder() .container_id(container) .privileged(true) .build(), @@ -432,7 +431,7 @@ pub trait RechunkDriver: RunDriver + BuildDriver + ContainerMountDriver { .build(), )?; Self::unmount_container( - &ContainerOpts::builder() + &super::opts::ContainerOpts::builder() .container_id(container) .privileged(true) .build(), @@ -503,7 +502,7 @@ pub trait RechunkDriver: RunDriver + BuildDriver + ContainerMountDriver { )?; Self::remove_volume( - &VolumeOpts::builder() + &super::opts::VolumeOpts::builder() .volume_id(ostree_cache_id) .privileged(true) .build(),