Skip to content

breakup containerImageRef.NewImageSource #6159

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hanwen-flow
Copy link
Contributor

@hanwen-flow hanwen-flow commented May 6, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • containerImageRef.NewImageSource is hard to follow because it is large; this reduces complexity a bit

  • container commit is bottlenecked (among others) by running the layer blob through sha256, which is single-threaded. This refactoring is a preparation to split the blob into multiple streams which can be processed in parallel (not part of this PR).

How to verify it

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

no.

@openshift-ci openshift-ci bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 6, 2025
Copy link
Contributor

openshift-ci bot commented May 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hanwen-flow
Once this PR has been reviewed and has the lgtm label, please assign baude for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

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

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@TomSweeneyRedHat
Copy link
Member

@hanwen-flow thanks for the PR. Looks like your branch needs an update, and there are all kinds of failing tests.

@hanwen-flow
Copy link
Contributor Author

Looks like your branch needs an update, and there are all kinds of failing tests.

you folks need to fix your CI:

go: go.mod requires go >= 1.23.3 (running go 1.23.1; GOTOOLCHAIN=local)

This PR doesn't introduce new functionality, hence no new tests (somebody with permissions has to set a label on this PR)

@hanwen-flow
Copy link
Contributor Author

@giuseppe

No functional changes, hence no test updates.

Signed-off-by: Han-Wen Nienhuys <[email protected]>
This shortens the huge function containerImageRef.NewImageSource.

No further code changes; no functional changes (hence, no tests).

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes (hence, no tests).

Signed-off-by: Han-Wen Nienhuys <[email protected]>
This reduces NewImageSource() complexity

Signed-off-by: Han-Wen Nienhuys <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants