aboutsummaryrefslogtreecommitdiff
path: root/src/garage/repair
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-02-03 15:27:39 +0100
committerAlex Auvolat <alex@adnab.me>2023-02-03 15:27:39 +0100
commit656b8d42de2fc945c988094418c90d29d000be32 (patch)
tree938aa46539d2c836cf8207d695ba70a9b686bcf6 /src/garage/repair
parent30f1636a00ffc60d1c9ac1d3781ccee21669e54d (diff)
downloadgarage-656b8d42de2fc945c988094418c90d29d000be32.tar.gz
garage-656b8d42de2fc945c988094418c90d29d000be32.zip
secrets can be passed directly in config, as file, or as env
Diffstat (limited to 'src/garage/repair')
-rw-r--r--src/garage/repair/offline.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/garage/repair/offline.rs b/src/garage/repair/offline.rs
index 25193e4a..f4edcf03 100644
--- a/src/garage/repair/offline.rs
+++ b/src/garage/repair/offline.rs
@@ -6,8 +6,13 @@ use garage_util::error::*;
use garage_model::garage::Garage;
use crate::cli::structs::*;
+use crate::{fill_secrets, Secrets};
-pub async fn offline_repair(config_file: PathBuf, opt: OfflineRepairOpt) -> Result<(), Error> {
+pub async fn offline_repair(
+ config_file: PathBuf,
+ secrets: Secrets,
+ opt: OfflineRepairOpt,
+) -> Result<(), Error> {
if !opt.yes {
return Err(Error::Message(
"Please add the --yes flag to launch repair operation".into(),
@@ -15,7 +20,7 @@ pub async fn offline_repair(config_file: PathBuf, opt: OfflineRepairOpt) -> Resu
}
info!("Loading configuration...");
- let config = read_config(config_file)?;
+ let config = fill_secrets(read_config(config_file)?, secrets);
info!("Initializing Garage main data store...");
let garage = Garage::new(config)?;