Expand description
Context describes the normalized and processed “settings” that a command can use at runtime. This differs from the “config” or the “CLI Arguments” as the Context is built and updated from those sources. This means the context is responsible for de-conflicting mutually exclusive options, or overriding values.
The Context is source of truth for all runtime decisions.
The order of evaluation is as follows (note lower layers override layers above):
- System configuration files are loaded (if any…currently none are defined)
- User configuration files are loaded (if any are found)
- Environment Variables (currently none are defined)
- Command Line Arguments 4a. Because we use subcommands and global arguments each subcommand acts as it’s own set of Command Line Arguments, and can thus affect the Context at each level in the command hierarchy. 4b. Before the Context is handed off mutably to the next nested level, all updates from the parent should be finalized.
After these steps the final Context is what is used to make runtime decisions.
The context struct itself contains “global” values or those that apply in many scenarios or to many commands. It also contains specialized contexts that contain values only relevant to those commands or processes that need them. These specialized contexts should be lazily derived.
Re-exports§
pub use flight::FlightCtx;pub use formation::FormationCfgCtx;pub use formation::FormationCtx;pub use metadata::MetadataCtx;pub use locks::LocksCtx;pub use restrict::RestrictCtx;
Modules§
Structs§
- Args
- Ctx
- The source of truth “Context” that is passed to all runtime processes to make decisions based on user configuration
- Db
- The in memory “Databases”
- Late
Init
Constants§
- DEFAULT_
IMAGE_ REGISTRY_ URL - The registry to use for image references when the registry is omitted by the user