-
Notifications
You must be signed in to change notification settings - Fork 3.8k
replace some hardcoded strings with ocispec consts #9255
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
Conversation
|
Skipping CI for Draft Pull Request. |
| 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), |
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.
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>
95dc94f to
b006f1c
Compare
| if opts != nil && opts.blobFilter != nil && !opts.blobFilter(desc) { | ||
| return tarRecord{} | ||
| } | ||
| path := path.Join("blobs", desc.Digest.Algorithm().String(), desc.Digest.Encoded()) |
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 was only used below, and path was colliding with the path import, so I inlined it
…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
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