Skip to content

Commit

Permalink
Do not push the config blob if it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt committed Apr 25, 2024
1 parent 335378e commit c14b830
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ocipkg/src/distribution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ pub fn push_image(path: &Path) -> Result<()> {
entry.read_to_end(&mut buf)?;
client.push_blob(&buf)?;
}
let digest = Digest::new(manifest.config().digest())?;
let mut entry = ar.get_blob(&digest)?;
let mut buf = Vec::new();
entry.read_to_end(&mut buf)?;
client.push_blob(&buf)?;
if manifest.config().media_type() != &MediaType::EmptyJSON {
let digest = Digest::new(manifest.config().digest())?;
let mut entry = ar.get_blob(&digest)?;
let mut buf = Vec::new();
entry.read_to_end(&mut buf)?;
client.push_blob(&buf)?;
}
client.push_manifest(&image_name.reference, &manifest)?;
}
Ok(())
Expand Down

0 comments on commit c14b830

Please sign in to comment.