Conversation
|
Packit jobs failed. @containers/packit-build please check. |
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
Podman test PR: containers/podman#28571 . |
| } | ||
| return nil, err | ||
| } | ||
| var res []string |
There was a problem hiding this comment.
we know how many items are in the sequence, worth preallocating?
There was a problem hiding this comment.
The code uses SplitSeq, so we don’t actually trivially know. We could scan one more time to count that, and have everyone carefully think about the required +1… And anyway this is the legacy path…
Actually the lowerLayers path is currently unnecessarily creating an iterator and then allocating anyway. I’ll fix that.
Hypothetically all of these could return iterators instead of allocating slices, but that would complicate error handling and the current uses of strings.Join.
... to be less confusing with a future getLowerLayerIDs. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
getLowerForParent never returns "" on success (and we are on a branch where parent != ""). Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This avoids Readlink() on layer IDs we _know_ are not links (and a risk of Readlink() actually finding something at that relative path), and simplifies users to again use unambiguous data contents. Then we can also use ordinary d.dir() to look up the directory to Stat(). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Don't bother with the d.dir() filesystem lookups; they will be equal iff the layer IDs are equal. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Only moves unchanged code, should not change behavior. Also document the difference between getLowerDirs and getLowerDiffPaths. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
(The rebase moves |
> go mod edit -replace go.podman.io/storage=github.com/mtrmac/container-libs/storage@overlay Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Following up on #666 (review) .
Marked as draft: