-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
package_test.go - Support OCI Image Layout #37727
package_test.go - Support OCI Image Layout #37727
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout. This works by reading the config and layer file names from the manifest.yml instead of assuming their names. Fixes elastic#37726
e66ddb2
to
66bffc7
Compare
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.
Thanks for this!
info, err = readDockerInfo(tarReader) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
case strings.HasSuffix(header.Name, "/layer.tar"): | ||
case slices.Contains(manifest.Layers, header.Name): |
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.
This isn't in 8.12 yet since it is still at Go 1.20, so is 7.17 but we plan to change that with #37694 since 7.17.18 will be after the Go 1.22 release.
I don't think we can put it into 8.12 since Go 1.21 modifies our support matrix by dropping Windows 8.1
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.
When we do the backport for 8.12 we can substitute in golang.org/x/exp/slices
or a helper function or a map.
💚 Build Succeeded
Expand to view the summary
Build stats
❕ Flaky test reportNo test was executed to be analysed. 🤖 GitHub commentsExpand to view the GitHub comments
To re-run your PR in the CI, just comment with:
|
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout. This works by reading the config and layer file names from the manifest.yml instead of assuming their names. Fixes #37726 (cherry picked from commit ebd8512) Co-authored-by: Andrew Kroh <[email protected]>
…37730) * package_test.go - Support OCI Image Layout (#37727) Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout. This works by reading the config and layer file names from the manifest.yml instead of assuming their names. Fixes #37726 (cherry picked from commit ebd8512) * Replace slices.Contains usage with helper func The 8.12 branch is not yet on Go 1.21 so the slices package isn't available.
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout. This works by reading the config and layer file names from the manifest.yml instead of assuming their names. Fixes elastic#37726
Proposed commit message
Modify TestDocker such that it can read both the original docker image layout and the OCI Image Layout. This works by reading the config and layer file names from the manifest.yml instead of assuming their names.
Fixes #37726
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Need to run it on a machine with an older docker and a new docker.
PLATFORMS=linux/amd64 SNAPSHOT=true mage -v package
Related issues
Notes
This is how the manifest.json looks under a docker export from Docker Engine 20.10.22.
And this is how the manifest.json looks under a docker export from Docker Engine 25.0.1.