mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
config: Add api to fetch config from default config path
Add api to fetch config from default config path and use that in kata-ctl tool. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
b908a780a0
commit
1016bc17b7
@ -127,6 +127,14 @@ impl TomlConfig {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Load raw Kata configuration information from default configuration file.
|
||||||
|
///
|
||||||
|
/// Configuration file is probed according to the default configuration file list
|
||||||
|
/// default::DEFAULT_RUNTIME_CONFIGURATIONS.
|
||||||
|
pub fn load_from_default() -> Result<(TomlConfig, PathBuf)> {
|
||||||
|
Self::load_raw_from_file("")
|
||||||
|
}
|
||||||
|
|
||||||
/// Load raw Kata configuration information from configuration files.
|
/// Load raw Kata configuration information from configuration files.
|
||||||
///
|
///
|
||||||
/// If `config_file` is valid, it will used, otherwise a built-in default path list will be
|
/// If `config_file` is valid, it will used, otherwise a built-in default path list will be
|
||||||
|
@ -449,7 +449,7 @@ pub fn handle_env(env_args: EnvArgument) -> Result<()> {
|
|||||||
Box::new(io::stdout())
|
Box::new(io::stdout())
|
||||||
};
|
};
|
||||||
|
|
||||||
let (toml_config, _) = TomlConfig::load_raw_from_file("").context("load toml config")?;
|
let (toml_config, _) = TomlConfig::load_from_default().context("load toml config")?;
|
||||||
|
|
||||||
let env_info = get_env_info(&toml_config)?;
|
let env_info = get_env_info(&toml_config)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user