replace some hardcoded strings with ocispec consts#9255
Merged
mxpv merged 2 commits intocontainerd:mainfrom Oct 17, 2023
Merged
replace some hardcoded strings with ocispec consts#9255mxpv merged 2 commits intocontainerd:mainfrom
mxpv merged 2 commits intocontainerd:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
thaJeztah
commented
Oct 17, 2023
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), |
Member
Author
There was a problem hiding this comment.
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 <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
95dc94f to
b006f1c
Compare
thaJeztah
commented
Oct 17, 2023
| if opts != nil && opts.blobFilter != nil && !opts.blobFilter(desc) { | ||
| return tarRecord{} | ||
| } | ||
| path := path.Join("blobs", desc.Digest.Algorithm().String(), desc.Digest.Encoded()) |
Member
Author
There was a problem hiding this comment.
This was only used below, and path was colliding with the path import, so I inlined it
dmcgowan
approved these changes
Oct 17, 2023
mxpv
approved these changes
Oct 17, 2023
kiashok
added a commit
to kiashok/containerd
that referenced
this pull request
Oct 23, 2024
…h upstream containerd/main update fork-external/main branch to upstream containerd/main at commit f90f80d Related work items: containerd#8736, containerd#8861, containerd#8924, containerd#8934, containerd#9027, containerd#9076, containerd#9104, containerd#9118, containerd#9141, containerd#9155, containerd#9177, containerd#9183, containerd#9184, containerd#9186, containerd#9187, containerd#9191, containerd#9200, containerd#9205, containerd#9211, containerd#9214, containerd#9215, containerd#9221, containerd#9223, containerd#9228, containerd#9231, containerd#9234, containerd#9242, containerd#9246, containerd#9247, containerd#9251, containerd#9253, containerd#9254, containerd#9255, containerd#9268
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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