diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-03-21 09:12:49 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-03-22 19:18:35 +0200 |
commit | 48139725676fcce89a70897546969623f2474693 (patch) | |
tree | f9c00d2fcd3b7c597fd5062b90ef2279eb9db767 /src/cmd/resolve.rs | |
parent | 4c94c794ec805cf643826973e4f83826a1231e54 (diff) | |
download | obnam2-48139725676fcce89a70897546969623f2474693.tar.gz |
feat! store list of generations in a "client trust root" chunk
Backups made with this version can't be restored with old clients, and
vice version.
Sponsored-by: author
Diffstat (limited to 'src/cmd/resolve.rs')
-rw-r--r-- | src/cmd/resolve.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/resolve.rs b/src/cmd/resolve.rs index 3b9570a..12432cc 100644 --- a/src/cmd/resolve.rs +++ b/src/cmd/resolve.rs @@ -1,5 +1,6 @@ //! The `resolve` subcommand. +use crate::chunk::ClientTrust; use crate::client::BackupClient; use crate::config::ClientConfig; use crate::error::ObnamError; @@ -22,7 +23,12 @@ impl Resolve { async fn run_async(&self, config: &ClientConfig) -> Result<(), ObnamError> { let client = BackupClient::new(config)?; - let generations = client.list_generations().await?; + let trust = client + .get_client_trust() + .await? + .or_else(|| Some(ClientTrust::new("FIXME", None, "".to_string(), vec![]))) + .unwrap(); + let generations = client.list_generations(&trust); match generations.resolve(&self.generation) { Err(err) => { |