image/tarexport: remove suport for loading v0/v1 images#50324
image/tarexport: remove suport for loading v0/v1 images#50324cpuguy83 merged 3 commits intomoby:masterfrom
Conversation
|
One test looks to be depending on this; |
|
OK, so the This test was written for a situation where the user created an archive that did contain entries for (layer) files, but those files were deliberately empty;
I'm keeping the test for now as a reminder that we may want to verify "empty files in archive" cases, but we can decide to consider this an invalid situation (either files must be included and non-empty, or omitted). |
This removes the tarexporter.legacyLoadImage method and related helpers. This functionality was added in 01ba0a9 (docker v1.10), which introduced the new content-addressable image format; this code provided backward-compatibility with older archives which contained v0/v1 images. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It was just checking if a value is nil; no need to maintain a utility for that. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
There was a problem hiding this comment.
Pull Request Overview
This PR removes legacy support for pre-Docker 1.10 (v0/v1) images and inlines simple manifest validation, updating related tests and error messages.
- Removed
tarexporter.legacyLoadImage, related helpers, and v1 compatibility code. - Inlined manifest
nilcheck inload.goand updated error messages. - Updated integration tests to skip legacy-format archives and fixed issue links.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| integration-cli/docker_cli_save_load_test.go | Updated issue URL in comment and marked legacy test as skipped. |
| image/v1/imagev1.go | Removed deprecated v1 helpers; left only CreateID and rawJSON. |
| image/tarexport/tarexport.go | Dropped unused legacy filename constants. |
| image/tarexport/load.go | Inlined manifest validation, removed legacy load logic, updated error messages. |
| image/tarexport/load_test.go | Deleted obsolete validateManifest tests. |
Comments suppressed due to low confidence (1)
image/tarexport/load.go:17
- The file now uses
fmt.Errorfanderrors.Newbut neitherfmtnorerrorsare imported. Please add"fmt"and"errors"to the import block.
"github.com/docker/distribution"
Hmm... let me check; I thought it was still used somewhere |
|
Yup; definitely still used; I have a suspicion that CoPilot ignores parts of the diff that are not shown for PRs; I've seen it do that in other cases (it considers code not shown to not exist); Lines 27 to 31 in 10e9ab6 |
image/tarexport: remove suport for loading v0/v1 images
This removes the tarexporter.legacyLoadImage method and related helpers.
This functionality was added in 01ba0a9
(docker v1.10), which introduced the new content-addressable image
format; this code provided backward-compatibility with older archives
which contained v0/v1 images.
image/tarexport: inline validateManifest utility
It was just checking if a value is nil; no need to maintain a utility
for that.
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)