mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +08:00
0b2eaa0f9a
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
36 lines
649 B
Go
36 lines
649 B
Go
//go:build sync
|
|
|
|
package sync
|
|
|
|
import (
|
|
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
"github.com/regclient/regclient/types/referrer"
|
|
|
|
"zotregistry.dev/zot/v2/pkg/common"
|
|
)
|
|
|
|
const (
|
|
cosignSignatureTagSuffix = "sig"
|
|
SBOMTagSuffix = "sbom"
|
|
)
|
|
|
|
func hasSignatureReferrers(refs referrer.ReferrerList) bool {
|
|
for _, desc := range refs.Descriptors {
|
|
tag := desc.Annotations[ispec.AnnotationRefName]
|
|
|
|
if common.IsCosignSignature(tag) {
|
|
return true
|
|
}
|
|
|
|
if desc.ArtifactType == common.ArtifactTypeNotation {
|
|
return true
|
|
}
|
|
|
|
if common.IsArtifactTypeCosign(desc.ArtifactType) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|