Skip to content

Commit 0c97906

Browse files
committed
throw if fail to setup trust repo, unless skip signature
Signed-off-by: Tuan Anh Tran <[email protected]>
1 parent 97841b7 commit 0c97906

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/oci.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ async fn setup_trust_repository(cli: &Cli) -> Result<Box<dyn TrustRoot>, anyhow:
8484
match SigstoreTrustRoot::new(None).await {
8585
Ok(repo) => return Ok(Box::new(repo)),
8686
Err(e) => {
87-
log::warn!("Failed to initialize TUF trust repository: {e}");
87+
log::error!("Failed to initialize TUF trust repository: {e}");
88+
if !cli.insecure_skip_signature {
89+
return Err(anyhow!("Failed to initialize TUF trust repository and signature verification is required"));
90+
}
8891
log::info!("Falling back to manual trust repository");
8992
}
9093
}

0 commit comments

Comments
 (0)