From bc596aefb1c048c58f5add825ae220a12371e984 Mon Sep 17 00:00:00 2001 From: Matthew Kenigsberg Date: Wed, 8 Dec 2021 14:51:48 -0600 Subject: [PATCH 1/3] cli: Expose certificate_directory Exposes the corresponding options from containers-image-proxy and skopeo Also changes authfile type from String to PathBuf for consistency Helps https://github.com/ostreedev/ostree-rs-ext/issues/121 Depends https://github.com/containers/containers-image-proxy-rs/pull/22 --- lib/src/cli.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/cli.rs b/lib/src/cli.rs index e6cbaee9..b5b0f187 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -10,6 +10,7 @@ use ostree::{gio, glib}; use std::collections::BTreeMap; use std::convert::TryFrom; use std::ffi::OsString; +use std::path::PathBuf; use structopt::StructOpt; use crate::container as ostree_container; @@ -130,7 +131,12 @@ enum ContainerOpts { struct ContainerProxyOpts { #[structopt(long)] /// Path to Docker-formatted authentication file. - authfile: Option, + authfile: Option, + + #[structopt(long)] + /// Directory with certificates (*.crt, *.cert, *.key) used to connect to registry + /// Equivalent to `skopeo --cert-dir` + cert_dir: Option, #[structopt(long)] /// Skip TLS verification. @@ -243,6 +249,7 @@ impl Into for ContainerProxyOpts { fn into(self) -> ostree_container::store::ImageProxyConfig { ostree_container::store::ImageProxyConfig { authfile: self.authfile, + certificate_directory: self.cert_dir, insecure_skip_tls_verification: Some(self.insecure_skip_tls_verification), ..Default::default() } From 204566b92f6cf162b3aabd63c1f8542d602881df Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 9 Dec 2021 16:27:35 -0500 Subject: [PATCH 2/3] Use containers-image-proxy from git --- lib/Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 1d1a980d..23b05a4f 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -10,7 +10,9 @@ version = "0.5.1" [dependencies] anyhow = "1.0" -containers-image-proxy = "0.3" +# containers-image-proxy = "0.3" +containers-image-proxy = { git = "https://github.com/containers/containers-image-proxy-rs" } + async-compression = { version = "0.3", features = ["gzip", "tokio"] } bitflags = "1" camino = "1.0.4" From 63f342cb0229f28b1ea446e446707c8e2359cf2e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 9 Dec 2021 16:35:55 -0500 Subject: [PATCH 3/3] cli: Suppress clippy enum variant warning It's not important here. --- lib/src/cli.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/cli.rs b/lib/src/cli.rs index b5b0f187..9f5a9317 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -235,6 +235,7 @@ struct ImaSignOpts { #[derive(Debug, StructOpt)] #[structopt(name = "ostree-ext")] #[structopt(rename_all = "kebab-case")] +#[allow(clippy::large_enum_variant)] enum Opt { /// Import and export to tar Tar(TarOpts),