mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
notaryv2: fix 'notation list'
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
f9d14d7f94
commit
45fe129c63
@@ -20,9 +20,9 @@ import (
|
||||
// Load s3 driver.
|
||||
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
|
||||
guuid "github.com/gofrs/uuid"
|
||||
"github.com/notaryproject/notation-go-lib"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1"
|
||||
"github.com/rs/zerolog"
|
||||
zerr "zotregistry.io/zot/errors"
|
||||
"zotregistry.io/zot/pkg/extensions/monitoring"
|
||||
@@ -1109,7 +1109,7 @@ func (is *ObjectStorage) GetBlobContent(repo string, digest string) ([]byte, err
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
func (is *ObjectStorage) GetReferrers(repo, digest string, mediaType string) ([]notation.Descriptor, error) {
|
||||
func (is *ObjectStorage) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error) {
|
||||
return nil, zerr.ErrMethodNotSupported
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/notaryproject/notation-go-lib"
|
||||
"github.com/opencontainers/go-digest"
|
||||
artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -42,5 +42,5 @@ type ImageStore interface {
|
||||
DeleteBlob(repo string, digest string) error
|
||||
GetIndexContent(repo string) ([]byte, error)
|
||||
GetBlobContent(repo, digest string) ([]byte, error)
|
||||
GetReferrers(repo, digest string, mediaType string) ([]notation.Descriptor, error)
|
||||
GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
guuid "github.com/gofrs/uuid"
|
||||
"github.com/minio/sha256-simd"
|
||||
"github.com/notaryproject/notation-go-lib"
|
||||
notreg "github.com/notaryproject/notation/pkg/registry"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/opencontainers/umoci"
|
||||
@@ -1381,7 +1382,7 @@ func (is *ImageStoreFS) DeleteBlob(repo string, digest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (is *ImageStoreFS) GetReferrers(repo, digest string, mediaType string) ([]notation.Descriptor, error) {
|
||||
func (is *ImageStoreFS) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error) {
|
||||
var lockLatency time.Time
|
||||
|
||||
dir := path.Join(is.rootDir, repo)
|
||||
@@ -1419,7 +1420,7 @@ func (is *ImageStoreFS) GetReferrers(repo, digest string, mediaType string) ([]n
|
||||
|
||||
found := false
|
||||
|
||||
result := []notation.Descriptor{}
|
||||
result := []artifactspec.Descriptor{}
|
||||
|
||||
for _, manifest := range index.Manifests {
|
||||
if manifest.MediaType != artifactspec.MediaTypeArtifactManifest {
|
||||
@@ -1451,9 +1452,10 @@ func (is *ImageStoreFS) GetReferrers(repo, digest string, mediaType string) ([]n
|
||||
continue
|
||||
}
|
||||
|
||||
result = append(result, notation.Descriptor{
|
||||
MediaType: manifest.MediaType,
|
||||
Digest: manifest.Digest, Size: manifest.Size, Annotations: manifest.Annotations,
|
||||
result = append(result, artifactspec.Descriptor{
|
||||
MediaType: manifest.MediaType,
|
||||
ArtifactType: notreg.ArtifactTypeNotation,
|
||||
Digest: manifest.Digest, Size: manifest.Size, Annotations: manifest.Annotations,
|
||||
})
|
||||
|
||||
found = true
|
||||
|
||||
Reference in New Issue
Block a user