Skip to content

Conversation

@thaJeztah
Copy link
Member

vendor: github.com/opencontainers/image-spec v1.1.0-rc5

full diff: opencontainers/image-spec@v1.1.0-rc4...v1.1.0-rc5

images/archive: replace hardcoded strings for OCI-spec consts

integration/client: replace hardcoded strings for OCI-spec consts

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Comment on lines +269 to +275
tc.Dir(ocispec.ImageBlobsDir, 0755),
tc.Dir(ocispec.ImageBlobsDir+"/sha256", 0755),
tc.File(ocispec.ImageBlobsDir+"/sha256/"+d1.Encoded(), b1, 0644),
tc.File(ocispec.ImageBlobsDir+"/sha256/"+d2.Encoded(), c1, 0644),
tc.File(ocispec.ImageBlobsDir+"/sha256/"+d3.Encoded(), m1, 0644),
tc.File(ocispec.ImageIndexFile, createIndex(m1, "latest", "docker.io/lib/img:ok"), 0644),
tc.File(ocispec.ImageLayoutFile, []byte(`{"imageLayoutVersion":"`+ocispec.ImageLayoutVersion+`"}`), 0644),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; open to input on these kind of changes in tests, because there's "pros" and "cons" to using consts here; "pro" can be discoverability (where are these parts of the spec used), but "cons" are that tests are less of a "fixture" (so may implicitly change if the spec would ever update the consts), and it may be less "grep-able" for the literal string.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review October 17, 2023 15:53
if opts != nil && opts.blobFilter != nil && !opts.blobFilter(desc) {
return tarRecord{}
}
path := path.Join("blobs", desc.Digest.Algorithm().String(), desc.Digest.Encoded())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only used below, and path was colliding with the path import, so I inlined it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants