mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
fix: revert "org.opencontainers.referrers.filtersApplied" (#1478)
As per latest dist-spec, this is now removed. Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
GitHub
parent
a3f355c278
commit
2202d6dfd4
@@ -560,26 +560,6 @@ func GetOrasReferrers(imgStore storageTypes.ImageStore, repo string, gdigest god
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func getReferrerFilterAnnotation(artifactTypes []string) string {
|
||||
// as per spec, return what filters were applied as an annotation if artifactTypes
|
||||
annotation := ""
|
||||
|
||||
for _, artifactType := range artifactTypes {
|
||||
if artifactType == "" {
|
||||
// ignore empty artifactTypes
|
||||
continue
|
||||
}
|
||||
|
||||
if annotation == "" {
|
||||
annotation = artifactType
|
||||
} else {
|
||||
annotation += "," + artifactType
|
||||
}
|
||||
}
|
||||
|
||||
return annotation
|
||||
}
|
||||
|
||||
func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godigest.Digest, artifactTypes []string,
|
||||
log zerolog.Logger,
|
||||
) (ispec.Index, error) {
|
||||
@@ -653,12 +633,6 @@ func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godiges
|
||||
Annotations: map[string]string{},
|
||||
}
|
||||
|
||||
// as per spec, return what filters were applied as an annotation if artifactTypes
|
||||
if annotation := getReferrerFilterAnnotation(artifactTypes); annotation != "" {
|
||||
index.Annotations[storageConstants.ReferrerFilterAnnotation] = annotation
|
||||
log.Info().Str("annotation", annotation).Msg("filters applied")
|
||||
}
|
||||
|
||||
return index, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user