[24.0 backport] c8d/legacybuilder: Fix mismatched image rootfs
errors
#46310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mismatched image rootfs
errors #46301- What I did
Fixed
CreateImage
losing the parent layers when creating a child image.This fixes
failed to export image: mismatched image rootfs and manifest layers
errors in integration-cli build tests with c8d enabled (#45232). Although this doesn't make all these tests green, as they now fail due to: #46194.- How I did it
Clone the passed
Image
and replace its ID instead of recreating it from scratch (and not setting all needed fields).- How to verify it
Before
After
$ make DOCKER_GRAPHDRIVER=overlayfs TEST_INTEGRATION_USE_SNAPSHOTTER=1 TEST_FILTER='TestBuildAddBadLinks' test-integration ... --- PASS: TestDockerCLIBuildSuite (3.24s) --- PASS: TestDockerCLIBuildSuite/TestBuildAddBadLinks (2.32s) --- PASS: TestDockerCLIBuildSuite/TestBuildAddBadLinksVolume (0.92s) ...
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)