Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #180 from mkenigs/cert_dir
Browse files Browse the repository at this point in the history
cli: Expose certificate_directory
  • Loading branch information
cgwalters authored Dec 9, 2021
2 parents 5f81bdc + 63f342c commit fd6dc4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -130,7 +131,12 @@ enum ContainerOpts {
struct ContainerProxyOpts {
#[structopt(long)]
/// Path to Docker-formatted authentication file.
authfile: Option<String>,
authfile: Option<PathBuf>,

#[structopt(long)]
/// Directory with certificates (*.crt, *.cert, *.key) used to connect to registry
/// Equivalent to `skopeo --cert-dir`
cert_dir: Option<PathBuf>,

#[structopt(long)]
/// Skip TLS verification.
Expand Down Expand Up @@ -229,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),
Expand All @@ -243,6 +250,7 @@ impl Into<ostree_container::store::ImageProxyConfig> 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()
}
Expand Down

0 comments on commit fd6dc4c

Please sign in to comment.