mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
refactor: Reduce binary size of zot-minimal; Added CI check for binary size (#1758)
Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/distribution/registry/storage/driver"
|
||||
notreg "github.com/notaryproject/notation-go/registry"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
"github.com/opencontainers/image-spec/schema"
|
||||
imeta "github.com/opencontainers/image-spec/specs-go"
|
||||
@@ -714,7 +713,7 @@ func IsSignature(descriptor ispec.Descriptor) bool {
|
||||
}
|
||||
|
||||
// is notation signature
|
||||
if descriptor.ArtifactType == notreg.ArtifactTypeNotation {
|
||||
if descriptor.ArtifactType == zcommon.ArtifactTypeNotation {
|
||||
return true
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -3,11 +3,10 @@ package storage
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/distribution/registry/storage/driver/factory"
|
||||
"github.com/gobwas/glob"
|
||||
notreg "github.com/notaryproject/notation-go/registry"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
|
||||
@@ -232,14 +231,14 @@ func CheckIsImageSignature(repoName string, manifestBlob []byte, reference strin
|
||||
manifestArtifactType := zcommon.GetManifestArtifactType(manifestContent)
|
||||
|
||||
// check notation signature
|
||||
if manifestArtifactType == notreg.ArtifactTypeNotation && manifestContent.Subject != nil {
|
||||
if manifestArtifactType == zcommon.ArtifactTypeNotation && manifestContent.Subject != nil {
|
||||
return true, NotationType, manifestContent.Subject.Digest, nil
|
||||
}
|
||||
|
||||
// check cosign
|
||||
cosignTagRule := glob.MustCompile("sha256-*.sig")
|
||||
cosignTagRule := regexp.MustCompile(`sha256\-.+\.sig`)
|
||||
|
||||
if tag := reference; cosignTagRule.Match(reference) {
|
||||
if tag := reference; cosignTagRule.MatchString(reference) {
|
||||
prefixLen := len("sha256-")
|
||||
digestLen := 64
|
||||
signedImageManifestDigestEncoded := tag[prefixLen : prefixLen+digestLen]
|
||||
|
||||
Reference in New Issue
Block a user