-
Notifications
You must be signed in to change notification settings - Fork 65
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
Remove extraneous code from CraneEngine #1216
Remove extraneous code from CraneEngine #1216
Conversation
from change #1216: |
internal/engine/engine.go
Outdated
w.CloseWithError(export(img, w)) | ||
}() | ||
fs := mutate.Extract(img) | ||
defer fs.Close() |
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.
If I'm reading this correctly, this close doesn't complete until the end of preflight's entire run. Should we close this explicitly sooner in success cases, or otherwise put in a closure to close it once the untar has completed?
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 are correct. Would be good to put in the closure to force the closure. :)
I'm a bit confused why we're losing code but also losing coverage here. |
Turns out that we were making an extra call to io.Copy that is completely unnecessary. We can use the io.Reader directly from crane's mutate.Extract call. Signed-off-by: Brad P. Crochet <brad@redhat.com>
160e232
to
8c4ca3c
Compare
from change #1216: |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: acornett21, bcrochet, komish The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a2143e3
into
redhat-openshift-ecosystem:main
Turns out that we were making an extra call to io.Copy that is completely unnecessary. We can use the io.Reader directly from crane's mutate.Extract call.