-
Notifications
You must be signed in to change notification settings - Fork 99
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
mutate: allow for custom compression #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, just a few API questions and cleanups that I reckon would be a good idea.
mutate/compress.go
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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 <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, I didn't consider that we could drop AddNonDistributable
entirely. Nice. 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 [email protected]