Struct ImageProxyConfig

Source
pub struct ImageProxyConfig {
    pub authfile: Option<PathBuf>,
    pub auth_data: Option<File>,
    pub auth_anonymous: bool,
    pub certificate_directory: Option<PathBuf>,
    pub decryption_keys: Option<Vec<String>>,
    pub insecure_skip_tls_verification: Option<bool>,
    pub debug: bool,
    pub skopeo_cmd: Option<Command>,
}
Expand description

Configuration for the proxy.

Fields§

§authfile: Option<PathBuf>

Path to container auth file; equivalent to skopeo --authfile. This conflicts with [auth_data].

§auth_data: Option<File>

Data stream for container auth. This conflicts with [authfile].

§auth_anonymous: bool

Do not use default container authentication paths; equivalent to skopeo --no-creds.

Defaults to false; in other words, use the default file paths from man containers-auth.json.

§certificate_directory: Option<PathBuf>§decryption_keys: Option<Vec<String>>

Decryption keys to decrypt an encrypted container image. equivalent to skopeo copy --decryption-key <path_to_decryption_key>

§insecure_skip_tls_verification: Option<bool>

If set, disable TLS verification. Equivalent to skopeo --tls-verify=false.

§debug: bool

If enabled, propagate debug-logging level from the proxy via stderr to the current process’ stderr. Note than when enabled, this also means that standard error will no longer be captured.

§skopeo_cmd: Option<Command>

Provide a configured std::process::Command instance.

This allows configuring aspects of the resulting child skopeo process. The intention of this hook is to allow the caller to use e.g. systemd-run or equivalent containerization tools. For example you can set up a command whose arguments are systemd-run -Pq -p DynamicUser=yes -- skopeo. You can also set up arbitrary aspects of the child via e.g. current_dir pre_exec.

The default is to wrap via util-linux setpriv --pdeathsig SIGTERM -- skopeo, which on Linux binds the lifecycle of the child process to the parent.

Note that you must add skopeo as the primary argument or indirectly. However, all other command line options including experimental-image-proxy will be injected by this library. You may use a different command name from skopeo if your application has set up a compatible copy, e.g. /usr/lib/myapp/my-private-skopeo/

Trait Implementations§

Source§

impl Debug for ImageProxyConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ImageProxyConfig

Source§

fn default() -> ImageProxyConfig

Returns the “default value” for a type. Read more
Source§

impl TryFrom<ImageProxyConfig> for Command

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(config: ImageProxyConfig) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more