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

Support a mode to emit estargz automagically. #871

Merged
merged 3 commits into from Dec 17, 2020

Conversation

mattmoor
Copy link
Collaborator

Fixes: #866

@mattmoor mattmoor force-pushed the estargz-layer branch 2 times, most recently from 3839d9e to 22cd44c Compare December 16, 2020 20:24
@codecov-io
Copy link

codecov-io commented Dec 16, 2020

Codecov Report

Merging #871 (1b79b13) into master (e87a6fc) will decrease coverage by 0.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #871      +/-   ##
==========================================
- Coverage   74.34%   74.33%   -0.02%     
==========================================
  Files         107      107              
  Lines        4486     4523      +37     
==========================================
+ Hits         3335     3362      +27     
- Misses        656      661       +5     
- Partials      495      500       +5     
Impacted Files Coverage Δ
pkg/v1/internal/estargz/estargz.go 100.00% <ø> (ø)
pkg/v1/tarball/layer.go 72.22% <69.23%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e87a6fc...1b79b13. Read the comment docs.

@mattmoor mattmoor force-pushed the estargz-layer branch 4 times, most recently from fcf725e to b3c2a25 Compare December 17, 2020 19:25
pkg/v1/internal/estargz/constants.go Outdated Show resolved Hide resolved
@@ -31,7 +34,7 @@ import (
//
// Refer to estargz for the options:
// https://pkg.go.dev/github.com/containerd/stargz-snapshotter@v0.2.0/estargz#Option
func ReadCloser(r io.ReadCloser, opts ...estargz.Option) (io.ReadCloser, v1.Hash, error) {
func ReadCloser(r io.ReadCloser, opts ...estargz.Option) (*estargz.Blob, v1.Hash, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm... so all we're doing here is actually implementing func(io.ReadCloser) (io.SectionReader, error)...

Do we really need this? If we want to keep it, can we update the return signature to match estargz.Build? I'd honestly rather they change their API and take advantage of any implemented interfaces, and then we just drop this entirely.

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 is a projection to our idioms, e.g. taking io.ReadCloser and returning v1.Hash (they cannot adopt the latter without a dependency cycle, but we could switch to using go-digest everywhere).

As #876 evolves, perhaps the necessity of this will diminish, but I think it's a useful place for us to mitigate things in the interim, and since it's internal there's effectively zero risk that we can't remove it. 🤷

@mattmoor mattmoor changed the title [WIP] Support a mode to emit estargz automagically. Support a mode to emit estargz automagically. Dec 17, 2020
@mattmoor mattmoor merged commit 687e0e3 into google:master Dec 17, 2020
@mattmoor mattmoor deleted the estargz-layer branch December 17, 2020 21:19
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.

Make it easy to support estargz
3 participants