-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Keep duplicate layers to match history #1017
Conversation
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.
I feel like this will work, but punting to @coollog for final check.
@@ -34,7 +34,7 @@ | |||
static class Builder { | |||
|
|||
private final ImageLayers.Builder<CachedLayerWithMetadata> layersBuilder = | |||
ImageLayers.builder(); | |||
ImageLayers.<CachedLayerWithMetadata>builder().removeDuplicates(); |
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.
Is <CachedLayerWithMetadata>
necessary?
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.
Yeah, get compiler errors otherwise as it resolves to ImageLayers<Layer>
.
public ImageLayers<T> build() { | ||
return new ImageLayers<>(ImmutableList.copyOf(layers), layerDigestsBuilder.build()); | ||
ImmutableList<T> layers; |
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.
What if we remove this variable assignment and push return
into each branch of if
? Disregard my comment if it won't look any better though.
Also add a bug fix entry in |
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.
I'm thinking maybe ImageLayers.Builder
should be instantiated with removeDuplicates
as true or false via ImageLayers.builder(boolean removeDuplcates)
so that it does add
differently based on the value of removeDuplicates
rather than having ImageLayers
reconstruct a LinkedHashSet
for the removeDuplicates=true
case.
I think it makes more sense to have the logic in |
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.
Okay, that sounds good.
Fixes #991