Repository navigation
mutate: allow for custom compression - #348
Conversation
cyphar
left a comment
There was a problem hiding this comment.
Seems reasonable, just a few API questions and cleanups that I reckon would be a good idea.
| type withClose struct { | ||
| r io.Reader | ||
| } | ||
|
|
||
| func (wc withClose) Read(p []byte) (n int, err error) { | ||
| return wc.r.Read(p) | ||
| } | ||
|
|
||
| func (wc withClose) Close() error { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
You can switch to ioutil.NopCloser and remove this wrapper.
|
And yeah, I can cook up the CLI UX for it. Oh and I like the new email btw. :P |
Instead of hard coding this media type, allow people to specify it in Add(). This lets us drop AddNonDistributable(), which was just copypasta of Add() with the media type changed. Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
a705649 to
5d0bf68
Compare
|
408 while uploading code coverage seems like a transient failure... I re-ran travis. |
at least via the API for now :) Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
5d0bf68 to
d82a276
Compare
Codecov Report
@@ Coverage Diff @@
## master #348 +/- ##
==========================================
+ Coverage 74.45% 74.50% +0.04%
==========================================
Files 57 58 +1
Lines 3054 3051 -3
==========================================
- Hits 2274 2273 -1
+ Misses 455 454 -1
+ Partials 325 324 -1
|
|
|
||
| // AddNonDistributable is the same as Add, except it adds a non-distributable | ||
| // layer to the image. | ||
| func (m *Mutator) AddNonDistributable(ctx context.Context, r io.Reader, history *ispec.History) (ispec.Descriptor, error) { |
There was a problem hiding this comment.
Huh, I didn't consider that we could drop AddNonDistributable entirely. Nice. 😸
cyphar
left a comment
There was a problem hiding this comment.
LGTM. The number of arguments to mutator.Add is getting a bit long but we can always deal with that some other time.
at least via the API for now :)
Signed-off-by: Tycho Andersen tycho@tycho.pizza