From 48139725676fcce89a70897546969623f2474693 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 21 Mar 2022 09:12:49 +0200 Subject: 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 --- src/cmd/inspect.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/cmd/inspect.rs') diff --git a/src/cmd/inspect.rs b/src/cmd/inspect.rs index d5a75c6..02801ae 100644 --- a/src/cmd/inspect.rs +++ b/src/cmd/inspect.rs @@ -1,5 +1,7 @@ //! The `inspect` subcommand. +use crate::backup_run::current_timestamp; +use crate::chunk::ClientTrust; use crate::client::BackupClient; use crate::config::ClientConfig; use crate::error::ObnamError; @@ -27,7 +29,12 @@ impl Inspect { async fn run_async(&self, config: &ClientConfig) -> Result<(), ObnamError> { let temp = NamedTempFile::new()?; let client = BackupClient::new(config)?; - let genlist = client.list_generations().await?; + let trust = client + .get_client_trust() + .await? + .or_else(|| Some(ClientTrust::new("FIXME", None, current_timestamp(), vec![]))) + .unwrap(); + let genlist = client.list_generations(&trust); let gen_id = genlist.resolve(&self.gen_id)?; info!("generation id is {}", gen_id.as_chunk_id()); -- cgit v1.2.1