Skip to content

Commit

Permalink
fix: smdk publish signing error w/ cross-fs tmp file (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
digikata committed Nov 2, 2022
1 parent b5e52ce commit c45e698
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions crates/fluvio-hub-util/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,16 @@ pub fn package_sign(in_pkgfile: &str, key: &Keypair, out_pkgfile: &str) -> Resul
signedpkg.finish()?;
drop(signedpkg);
signedfile.flush()?;
signedfile.persist(&out_pkgfile).map_err(|e| {
warn!("{}", e);
HubUtilError::PackageSigning(format!("{in_pkgfile}: fault creating signed package"))
})?;

let sf_path = signedfile.path().to_path_buf();
if let Err(e) = signedfile.persist(&out_pkgfile) {
warn!("{}, falling back to copy", e);
std::fs::copy(sf_path, &out_pkgfile).map_err(|e| {
warn!("copy failure {}", e);
HubUtilError::PackageSigning(format!(
"{in_pkgfile}: fault creating signed package\n{e}"
))
})?;
}
Ok(())
}

Expand Down

0 comments on commit c45e698

Please sign in to comment.