notaryv2: fix 'notation list'

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani
2022-01-31 21:33:07 +00:00
committed by Ramkumar Chinchani
parent f9d14d7f94
commit 45fe129c63
5 changed files with 22 additions and 11 deletions
+9
View File
@@ -3322,6 +3322,15 @@ func TestImageSignatures(t *testing.T) {
So(msg, ShouldNotBeEmpty)
So(strings.Contains(msg, "verification failure"), ShouldBeFalse)
// check list
cmd = exec.Command("notation", "list", "--plain-http", image)
out, err = cmd.CombinedOutput()
So(err, ShouldBeNil)
msg = strings.TrimSuffix(string(out), "\n")
So(msg, ShouldNotBeEmpty)
_, err = godigest.Parse(msg)
So(err, ShouldBeNil)
// verify the image with incorrect key
cmd = exec.Command("notation", "verify", "--cert", "bad", "--plain-http", image)
out, err = cmd.CombinedOutput()
+2 -2
View File
@@ -24,9 +24,9 @@ import (
"github.com/gorilla/mux"
jsoniter "github.com/json-iterator/go"
"github.com/notaryproject/notation-go-lib"
notreg "github.com/notaryproject/notation/pkg/registry"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1"
httpSwagger "github.com/swaggo/http-swagger"
zerr "zotregistry.io/zot/errors"
ext "zotregistry.io/zot/pkg/extensions"
@@ -1361,7 +1361,7 @@ func getImageManifest(routeHandler *RouteHandler, imgStore storage.ImageStore, n
}
type ReferenceList struct {
References []notation.Descriptor `json:"references"`
References []artifactspec.Descriptor `json:"references"`
}
// GetReferrers godoc