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:
@@ -23,6 +23,9 @@ const (
|
||||
CosignSignature = "cosign"
|
||||
CosignSigKey = "dev.cosignproject.cosign/signature"
|
||||
NotationSignature = "notation"
|
||||
// same value as github.com/notaryproject/notation-go/registry.ArtifactTypeNotation (assert by internal test).
|
||||
// reason used: to reduce zot minimal binary size (otherwise adds oras.land/oras-go/v2 deps).
|
||||
ArtifactTypeNotation = "application/vnd.cncf.notary.signature"
|
||||
)
|
||||
|
||||
func Contains[T comparable](elems []T, v T) bool {
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
notreg "github.com/notaryproject/notation-go/registry"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
"zotregistry.io/zot/pkg/api/config"
|
||||
@@ -56,4 +57,8 @@ func TestCommon(t *testing.T) {
|
||||
So(common.Index([]string{"a", "b"}, "b"), ShouldEqual, 1)
|
||||
So(common.Index([]string{"a", "b"}, "c"), ShouldEqual, -1)
|
||||
})
|
||||
|
||||
Convey("Test ArtifactTypeNotation const has same value as in notaryproject", t, func() {
|
||||
So(common.ArtifactTypeNotation, ShouldEqual, notreg.ArtifactTypeNotation)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user