Skip to content

Commit

Permalink
fix config layer not proxied
Browse files Browse the repository at this point in the history
  • Loading branch information
awoimbee committed Jan 20, 2025
1 parent 0093cb9 commit 8b1cb4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/registry/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ impl OCIManifest {
// We could recurse into the manifests, but they should have been checked already.
list.manifests()
.iter()
.filter(|l| layer_is_distributable(l.media_type()))
.map(|x| x.digest().to_string())
.collect()
}
Expand Down
14 changes: 7 additions & 7 deletions src/registry/proxy/proxy_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,21 @@ async fn download_manifest_and_layers(
.await?;

match &manifest {
OCIManifest::List(m) => {
let images_to_dl = m
.manifests()
OCIManifest::List(_) => {
let images_to_dl = manifest
.get_local_asset_digests()
.iter()
.map(|m| ref_.clone_with_digest(m.digest().as_ref().to_string()))
.map(|digest| ref_.clone_with_digest(digest.to_string()))
.collect::<Vec<_>>();
let futures = images_to_dl.iter().map(|img| {
download_manifest_and_layers(cl, auth, db.clone(), storage, img, local_repo_name)
});
try_join_all(futures).await?;
}
OCIManifest::V2(m) => {
let layer_digests = m.layers().iter().map(|layer| layer.digest().as_ref());
OCIManifest::V2(_) => {
let layer_digests = manifest.get_local_asset_digests();
let futures = layer_digests
.clone()
.iter()
.map(|l| download_blob(cl, db.clone(), storage, ref_, l, local_repo_name));
try_join_all(futures).await?;
}
Expand Down
4 changes: 0 additions & 4 deletions src/registry/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ impl TrowStorageBackend {
}
}

// fn is_proxy_repo(repo_name: &str) -> bool {
// repo_name.starts_with(PROXY_DIR)
// }

#[cfg(test)]
mod tests {

Expand Down

0 comments on commit 8b1cb4e

Please sign in to comment.