feat: add gc command and fix Docker-Content-Digest for Helm OCI

- Add nora gc --dry-run command for orphaned blob cleanup
- Fix Docker-Content-Digest header in blob upload response (enables Helm OCI push)
- Mark-and-sweep GC: list blobs, parse manifests, find/delete orphans

DevITWay
This commit is contained in:
2026-03-03 10:28:39 +00:00
parent e34032d08f
commit f560e5f76b
3 changed files with 144 additions and 1 deletions

View File

@@ -307,7 +307,14 @@ async fn upload_blob(
));
state.repo_index.invalidate("docker");
let location = format!("/v2/{}/blobs/{}", name, digest);
(StatusCode::CREATED, [(header::LOCATION, location)]).into_response()
(
StatusCode::CREATED,
[
(header::LOCATION, location),
(HeaderName::from_static("docker-content-digest"), digest.to_string()),
],
)
.into_response()
}
Err(_) => StatusCode::INTERNAL_SERVER_ERROR.into_response(),
}