Lint fixes
This commit is contained in:
parent
4537e29b55
commit
9a3523a8a1
3 changed files with 20 additions and 21 deletions
|
|
@ -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<types::MountId> {
|
||||
fn mount_container(opts: &opts::ContainerOpts) -> Result<types::MountId> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<ImageMetadata> {
|
|||
|
||||
#[cfg(feature = "rechunk")]
|
||||
impl ContainerMountDriver for PodmanDriver {
|
||||
fn mount_container(opts: &ContainerOpts) -> Result<MountId> {
|
||||
fn mount_container(opts: &super::opts::ContainerOpts) -> Result<MountId> {
|
||||
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!(
|
||||
|
|
|
|||
|
|
@ -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<MountId>;
|
||||
fn mount_container(opts: &super::opts::ContainerOpts) -> Result<MountId>;
|
||||
|
||||
/// 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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue