fix(oci): cache tag lists and normalize manifest variants - #280
Open
abhinavgautam01 wants to merge 2 commits into
Open
fix(oci): cache tag lists and normalize manifest variants#280abhinavgautam01 wants to merge 2 commits into
abhinavgautam01 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves OCI offline behavior by caching tag-list responses and making manifest caching more robust across equivalent Accept header variants, so previously warmed caches can be reused when upstream registry/token services are unavailable.
Changes:
- Add automatic caching (with stale fallback) for OCI
/v2/<name>/tags/listresponses, independent of general metadata caching. - Normalize manifest
Acceptheaders for cache-key derivation and validate cached manifest content types against the caller’sAccept. - Add tests and documentation for OCI tag-list + manifest offline caching behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/handler/container.go | Routes tag-list requests through the new cached implementation. |
| internal/handler/container_tags.go | Implements tag-list caching, ETag revalidation, and stale fallback behavior. |
| internal/handler/container_manifest.go | Normalizes Accept for cache keys and validates cached manifest content type against request. |
| internal/handler/container_test.go | Adds coverage for stale tag-list fallback and manifest variant normalization/content-type gating. |
| docs/configuration.md | Documents always-cached OCI manifests and tag lists + stale behavior. |
| docs/architecture.md | Updates architecture notes to include tag lists as always-cached metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #249
Summary
/v2/<name>/tags/listresponses automatically, including when general metadata caching is disabled.Acceptheaders before deriving cache keys, so equivalent media-type lists reuse the same cached variant.Validation
gofmtgo tool golangci-lint run ./...go vet ./...go test -race ./...git diff --check