From 270aa65a59113bacaf4057857aede8c4ae5695f7 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 29 Oct 2024 01:01:02 -0600 Subject: [PATCH] fix: platform config type (#1518) Signed-off-by: Terry Howe --- cmd/oras/root/push.go | 2 +- test/e2e/internal/testdata/foobar/const.go | 4 ++-- test/e2e/suite/command/push.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/oras/root/push.go b/cmd/oras/root/push.go index f053cec38..323468d39 100644 --- a/cmd/oras/root/push.go +++ b/cmd/oras/root/push.go @@ -197,7 +197,7 @@ func runPush(cmd *cobra.Command, opts *pushOptions) error { if err != nil { return err } - mediaType := oras.MediaTypeUnknownConfig + mediaType := ocispec.MediaTypeImageConfig if opts.Flag == option.ImageSpecV1_0 && opts.artifactType != "" { mediaType = opts.artifactType } diff --git a/test/e2e/internal/testdata/foobar/const.go b/test/e2e/internal/testdata/foobar/const.go index e4b39cfb2..70af1eb3d 100644 --- a/test/e2e/internal/testdata/foobar/const.go +++ b/test/e2e/internal/testdata/foobar/const.go @@ -41,7 +41,7 @@ var ( PlatformConfigSize = 38 PlatformConfigDigest = digest.Digest("sha256:e94c0ba80a1157ffab5b5c6656fffc089c6446c7ed0604f3382910d1ef7dd40d") PlatformConfigStateKey = match.StateKey{ - Digest: "e94c0ba80a11", Name: "application/vnd.unknown.config.v1+json", + Digest: "e94c0ba80a11", Name: "application/vnd.oci.image.config.v1+json", } PlatformV10ConfigSize = 38 @@ -50,7 +50,7 @@ var ( Digest: "e94c0ba80a11", Name: "test/artifact+json", } PlatformV1DEfaultConfigStateKey = match.StateKey{ - Digest: "e94c0ba80a11", Name: "application/vnd.unknown.config.v1+json", + Digest: "e94c0ba80a11", Name: "application/vnd.oci.image.config.v1+json", } FileBarName = "foobar/bar" diff --git a/test/e2e/suite/command/push.go b/test/e2e/suite/command/push.go index cfba901bc..7dba0b3a2 100644 --- a/test/e2e/suite/command/push.go +++ b/test/e2e/suite/command/push.go @@ -674,7 +674,7 @@ var _ = Describe("OCI image layout users:", func() { var manifest ocispec.Manifest Expect(json.Unmarshal(fetched, &manifest)).ShouldNot(HaveOccurred()) Expect(manifest.Config).Should(Equal(ocispec.Descriptor{ - MediaType: "application/vnd.unknown.config.v1+json", + MediaType: "application/vnd.oci.image.config.v1+json", Size: int64(foobar.PlatformV10ConfigSize), Digest: foobar.PlatformV10ConfigDigest, }))