Skip to main content

Config

Struct Config 

Source
pub(crate) struct Config {
    version: Option<Verbosity>,
    version_json: Option<Verbosity>,
    log_level: LogLevel,
    log_driver: LogDriver,
    runtime: PathBuf,
    runtime_dir: PathBuf,
    runtime_root: Option<PathBuf>,
    skip_fork: bool,
    enable_tracing: bool,
    tracing_endpoint: String,
}
Expand description

A pod level OCI container runtime monitor, started by a container engine like CRI-O.

Fields§

§version: Option<Verbosity>

Show version information, specify “full” for verbose output.

§version_json: Option<Verbosity>

Show version information as parsable JSON, specify “full” for verbose output.

§log_level: LogLevel

The logging level of the server.

§log_driver: LogDriver

The logging driver used by the server.

§runtime: PathBuf

Binary path of the OCI runtime to use to operate on the containers. Required to run the server.

§runtime_dir: PathBuf

Path of the directory for conmonrs to hold files at runtime. Required to run the server.

§runtime_root: Option<PathBuf>

Root directory used by the OCI runtime to operate on containers, passed to it as --root.

§skip_fork: bool

Stay in the foreground instead of forking into the background.

§enable_tracing: bool

Enable OpenTelemetry tracing. Builds without the tracing feature ignore it with a warning.

§tracing_endpoint: String

OpenTelemetry gRPC endpoint to be used for tracing. Builds without the tracing feature ignore it.

Implementations§

Source§

impl Config

Source

pub(crate) fn version(&self) -> Option<Verbosity>

Show version information.

Source

pub(crate) fn version_json(&self) -> Option<Verbosity>

Show version information as JSON.

Source

pub(crate) fn log_level(&self) -> LogLevel

The logging level.

Source

pub(crate) fn log_driver(&self) -> LogDriver

The logging driver.

Source

pub(crate) fn runtime(&self) -> &Path

Binary path of the OCI runtime.

Source

pub(crate) fn runtime_is_crun(&self) -> bool

Whether the runtime is crun, which gets arguments of its own, see GenerateRuntimeArgs::default_args.

Source

pub(crate) fn runtime_dir(&self) -> &Path

Path of the directory for conmonrs to hold files at runtime.

Source

pub(crate) fn runtime_root(&self) -> Option<&Path>

Root directory used by the OCI runtime.

Source

pub(crate) fn skip_fork(&self) -> bool

Stay in the foreground instead of forking into the background.

Source

pub(crate) fn enable_tracing(&self) -> bool

Enable OpenTelemetry tracing.

Source

pub(crate) fn tracing_endpoint(&self) -> &str

OpenTelemetry gRPC endpoint.

Source§

impl Config

Source

pub(crate) fn parse_args() -> Self

Parse the configuration from the command line and the environment.

Source§

impl Config

Source

pub(crate) fn validate(&self) -> Result<()>

Validate the configuration integrity.

Source

pub(crate) fn make_absolute(&mut self) -> Result<()>

Make the paths absolute, the server changes into the root directory once it started, see Server::start.

Source

pub(crate) fn prepare(&self) -> Result<()>

Create the runtime directories and remove stale sockets. Separate from Config::validate, which only checks and changes nothing on disk.

Source

fn socket_in_use(path: &Path) -> Result<bool>

Whether a server accepts connections on the socket. The connect does not wait for a server which does not accept them in time, a full backlog counts as in use as well. A socket of a server which exited is not in use, also if a process left behind still holds it.

Source

fn peer_running(fd: &impl AsFd) -> bool

Whether the process which listens on the other end of a connection still runs, true if that cannot be told.

Source

pub(crate) fn socket(&self) -> PathBuf

The socket the server serves the RPCs on.

Source

pub(crate) fn conmon_pidfile(&self) -> PathBuf

The PID file the parent writes for the forked server.

Trait Implementations§

Source§

impl Args for Config

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Config

Source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
Source§

impl Debug for Config

Source§

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

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

impl Eq for Config

Source§

impl FromArgMatches for Config

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Config

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Config

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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