Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RWLock, limit scope of locking, write digest first #1734

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

mattmoor
Copy link
Collaborator

No description provided.

continue
}
if desc.MediaType.IsIndex() || desc.MediaType.IsImage() {
if _, found := m.manifests[repo][desc.Digest.String()]; !found {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be safe, even if m.manifests[repo] is uninitialized: https://go.dev/play/p/i3MTYkyWacp

Signed-off-by: Matt Moore <mattmoor@chainguard.dev>
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2023

Codecov Report

Merging #1734 (1ec3795) into main (44a6e2e) will increase coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head 1ec3795 differs from pull request most recent head 30d1947. Consider uploading reports for the commit 30d1947 to get more accurate results

@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
+ Coverage   71.87%   71.96%   +0.08%     
==========================================
  Files         122      122              
  Lines        9822     9832      +10     
==========================================
+ Hits         7060     7076      +16     
+ Misses       2082     2078       -4     
+ Partials      680      678       -2     
Impacted Files Coverage Δ
pkg/registry/manifest.go 94.22% <100.00%> (+0.18%) ⬆️

... and 1 file with indirect coverage changes

@mattmoor mattmoor enabled auto-merge (squash) June 16, 2023 22:56
@mattmoor mattmoor merged commit db818dc into google:main Jun 16, 2023
18 checks passed
@mattmoor mattmoor deleted the manifests-rwlock branch June 16, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants