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

Remove extraneous code from CraneEngine #1216

Merged

Conversation

bcrochet
Copy link
Contributor

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2024
@coveralls
Copy link

coveralls commented Nov 22, 2024

Coverage Status

coverage: 84.43% (-0.02%) from 84.446%
when pulling 8c4ca3c on bcrochet:remove-extra-code
into 0184783 on redhat-openshift-ecosystem:main.

@dcibot
Copy link

dcibot commented Nov 22, 2024

w.CloseWithError(export(img, w))
}()
fs := mutate.Extract(img)
defer fs.Close()
Copy link
Contributor

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?

Copy link
Contributor Author

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. :)

@komish
Copy link
Contributor

komish commented Nov 26, 2024

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>
@dcibot
Copy link

dcibot commented Nov 27, 2024

Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 2, 2024
Copy link

openshift-ci bot commented Dec 2, 2024

[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:
  • OWNERS [acornett21,bcrochet,komish]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acornett21 acornett21 merged commit a2143e3 into redhat-openshift-ecosystem:main Dec 2, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants