Skip to content

Commit

Permalink
remove extra data from descriptor to match API spec
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Alvarez <[email protected]>
  • Loading branch information
pendo324 committed Dec 20, 2024
1 parent aa1a06e commit fd9cd2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
11 changes: 3 additions & 8 deletions internal/service/distribution/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,9 @@ func (s *service) Inspect(ctx context.Context, name string, ac *dockertypes.Auth

return &registrytypes.DistributionInspect{
Descriptor: ocispec.Descriptor{
MediaType: desc.MediaType,
Digest: desc.Digest,
Size: desc.Size,
URLs: desc.URLs,
Annotations: desc.Annotations,
Data: desc.Data,
Platform: desc.Platform,
ArtifactType: desc.ArtifactType,
MediaType: desc.MediaType,
Digest: desc.Digest,
Size: desc.Size,
},
Platforms: platforms,
}, nil
Expand Down
14 changes: 7 additions & 7 deletions internal/service/distribution/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ var _ = Describe("Distribution Inspect API ", func() {
MediaType: ocispec.MediaTypeImageIndex,
Digest: "sha256:9bae60c369e612488c2a089c38737277a4823a3af97ec6866c3b4ad05251bfa5",
Size: 2,
URLs: []string{},
Annotations: map[string]string{},
Data: []byte{},
Platform: &ociPlatformAmd,
URLs: nil,
Annotations: nil,
Data: nil,
Platform: nil,
}

imageDescriptor1 = ocispec.Descriptor{
Expand Down Expand Up @@ -140,9 +140,9 @@ var _ = Describe("Distribution Inspect API ", func() {
MediaType: ocispec.MediaTypeImageManifest,
Digest: "sha256:9b13590c9a50929020dc76a30ad813e42514a4e34de2f04f5a088f5a1320367c",
Size: 2,
URLs: []string{},
Annotations: map[string]string{},
Data: []byte{},
URLs: nil,
Annotations: nil,
Data: nil,
}

imageManifest = ocispec.Manifest{
Expand Down

0 comments on commit fd9cd2f

Please sign in to comment.