From 43165c0e6c632043ea925960b8a3a90bd6519023 Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Tue, 21 Jan 2025 21:26:40 +0800 Subject: [PATCH] revert case Signed-off-by: Lixia (Sylvia) Lei --- registry/remote/repository_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/registry/remote/repository_test.go b/registry/remote/repository_test.go index 26b65257..fbc88f4f 100644 --- a/registry/remote/repository_test.go +++ b/registry/remote/repository_test.go @@ -7815,6 +7815,32 @@ func TestManifestStore_generateDescriptor(t *testing.T) { wantDescriptor: ocispec.Descriptor{}, wantErr: true, }, + { + name: "resp with body, missing Docker-Content-Digest", + resp: &http.Response{ + Header: http.Header{ + "Content-Type": []string{mediaType}, + }, + ContentLength: dataSize, + Request: &http.Request{ + Method: http.MethodGet, + URL: &url.URL{Path: "/test"}, + }, + Body: io.NopCloser(bytes.NewReader(data)), + }, + ref: registry.Reference{ + Registry: "registry.example.com", + Repository: "hello-world", + Reference: dataDigest.String(), + }, + httpMethod: http.MethodGet, + wantDescriptor: ocispec.Descriptor{ + MediaType: mediaType, + Digest: dataDigest, + Size: dataSize, + }, + wantErr: false, + }, { name: "failed to read resp with body, missing Docker-Content-Digest", resp: &http.Response{