mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-29 03:57:56 +01:00
fix issue
Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
ca37911113
commit
918fe125b7
@ -16,6 +16,7 @@ package image
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"github.com/opencontainers/go-digest"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
@ -35,11 +36,11 @@ func (f *fakeRegistry) FetchArtifacts([]*model.Filter) ([]*model.Resource, error
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fakeRegistry) ManifestExist(repository, reference string) (bool, string, error) {
|
func (f *fakeRegistry) ManifestExist(repository, reference string) (bool, *distribution.Descriptor, error) {
|
||||||
if repository == "destination" && reference == "b1" {
|
if repository == "destination" && reference == "b1" {
|
||||||
return true, "sha256:c6b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7", nil
|
return true, &distribution.Descriptor{Digest: digest.Digest("sha256:c6b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7")}, nil
|
||||||
}
|
}
|
||||||
return false, "sha256:c6b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7", nil
|
return false, &distribution.Descriptor{Digest: digest.Digest("sha256:c6b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7")}, nil
|
||||||
}
|
}
|
||||||
func (f *fakeRegistry) PullManifest(repository, reference string, accepttedMediaTypes ...string) (distribution.Manifest, string, error) {
|
func (f *fakeRegistry) PullManifest(repository, reference string, accepttedMediaTypes ...string) (distribution.Manifest, string, error) {
|
||||||
manifest := `{
|
manifest := `{
|
||||||
|
Loading…
Reference in New Issue
Block a user