Skip to content

Conversation

@imjasonh
Copy link
Contributor

@imjasonh imjasonh commented Jun 14, 2022

When pulling a manifest, if the response includes an ETag header, hold on to it, and send that back in an If-Match request header when putting that manifest back.

This should prevent some race conditions during read-modify-write cycles, if the registry respects the If-Match header, since the resource's etag will have changed when the other client updated it.

TODO: Add test.

@imjasonh imjasonh requested a review from jonjohnsonjr June 14, 2022 18:22
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2022

Codecov Report

Attention: Patch coverage is 50.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 74.12%. Comparing base (12aeccc) to head (8eed56d).
Report is 222 commits behind head on main.

Files with missing lines Patch % Lines
pkg/v1/mutate/image.go 0.00% 5 Missing ⚠️
pkg/v1/remote/descriptor.go 69.23% 4 Missing ⚠️
pkg/v1/remote/write.go 0.00% 2 Missing and 1 partial ⚠️
pkg/v1/remote/image.go 50.00% 1 Missing ⚠️
pkg/v1/remote/index.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1386      +/-   ##
==========================================
- Coverage   74.19%   74.12%   -0.07%     
==========================================
  Files         113      113              
  Lines        8458     8474      +16     
==========================================
+ Hits         6275     6281       +6     
- Misses       1575     1584       +9     
- Partials      608      609       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonjohnsonjr
Copy link
Collaborator

Maybe it's time to have formal unwrapping?

I was thinking something more along the lines of #1387 for the partial stuff, but it might be better to have an actual unwrapping API (borrowed from https://go.dev/blog/go1.13-errors) so we can check "does this (or something it wraps) implement ETag?" instead of just returning an empty string.

@github-actions
Copy link

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@oofnish
Copy link

oofnish commented Feb 7, 2023

Hello, I know this PR is currently closed, but I'm interested in picking up and running with the ETag support here. Is it just tests that are missing for this, or would the "Formal unwrapping" approach be a requirement for a MVP here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants