Skip to content

Commit 0827ee9

Browse files
committed
Add config file env fix to azure.rs as well
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent b8cffdc commit 0827ee9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/azure.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ struct AzureConfig {
4242
/// Get Azure credentials from config.toml
4343
fn get_azure_credentials(name: &str) -> AzureConfig {
4444
let args = Args::parse();
45-
let cfg_file = args.config_file;
45+
let mut cfg_file = args.config_file;
46+
// check if env variable available KCI_STORAGE_CONFIG
47+
if let Ok(env_cfg_file) = std::env::var("KCI_STORAGE_CONFIG") {
48+
cfg_file = env_cfg_file;
49+
}
4650
let cfg_content = std::fs::read_to_string(cfg_file).unwrap();
4751
let cfg: Table = toml::from_str(&cfg_content).unwrap();
4852
let azure_cfg = cfg.get(name).unwrap();

0 commit comments

Comments
 (0)