libimage.runtime.layerTree: Use consistent layers and images#2125
libimage.runtime.layerTree: Use consistent layers and images#2125openshift-merge-bot[bot] merged 4 commits intocontainers:mainfrom
Conversation
c1113a8 to
599eb71
Compare
mtrmac
left a comment
There was a problem hiding this comment.
Note particularly the comment about racy lookups; I don’t immediately know what to do there.
Maybe we can change the callers instead — I see only Podman’s Mount and Unmount, maybe those could get a ListImagesByNames with one set of features, and everyone else could get an ListAllImages with the names parameter removed entirely.
We need to resolve this somehow, I didn’t analyze the callers enough to have an opinion yet.
As a general principle, a commit should go from a buildable (ideally, working) codebase to a buildable codebase; don’t split a change of a function parameter from updates of callers into separate commits. (The reason is to make git bisect work well, and to generally make it possible to do backports without having to think too much about the commit sequence.)
fc5b51a to
cc7ded3
Compare
|
@mtrmac Did you add a bogus comment? |
|
Yes, I’m sorry — I think all the pending review comments got published in the meantime. |
5d8807d to
e3ae831
Compare
mtrmac
left a comment
There was a problem hiding this comment.
Great, that solves that problem.
Now, can we fix the other one as well, and do the filtering based on the same layerTree? I think this should work:
- Have
compileImageFiltersalso return a “needs a layer tree” boolean - Add a
*layerTreeparameter tofilterFunc; move tree creation fromcompileImageFilterstofilterImages(based on the boolean from the previous step) - Then move
compileImageFiltersdirectly intoListImages, and call it before theMultiList MultiListwill now know whether alayerTreeis necessary, and always create only one.
This is getting a bit large — can this be split into at least 3 commits?
- Add
ListImagesByNames, change theListImagesAPI, without changing the implementation - Refactor
filterImages+filterFuncto create the tree infilterFunc - Use
MultiList, and all the other stuff.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
5c42955 to
0177418
Compare
mtrmac
left a comment
There was a problem hiding this comment.
Thanks! ACK overall, just some nits to help future maintainers.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
|
@vrothberg PTAL |
No time to review, sorry. I trust the PR has been thoroughly reviewed :) |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Honny1, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR changes
runtime.layerTreemethod to use consistent values for the creation of layerTree. Before images and layers could vary between calls that obtain images and layers now usingstorage.MultiListto obtain consistent images and layers. Also, this PR adapts callers ofruntime.layerTreeto use consistent images and layers and vendor pre-release ofc/storagewithstorage.MultiListmethod.Fixes: containers/podman#23331
Depends on: #2131