mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05: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:
parent
a3f355c278
commit
2202d6dfd4
2 changed files with 15 additions and 42 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -6,20 +6,19 @@ import (
|
|||
|
||||
const (
|
||||
// BlobUploadDir defines the upload directory for blob uploads.
|
||||
BlobUploadDir = ".uploads"
|
||||
SchemaVersion = 2
|
||||
DefaultFilePerms = 0o600
|
||||
DefaultDirPerms = 0o700
|
||||
RLOCK = "RLock"
|
||||
RWLOCK = "RWLock"
|
||||
BlobsCache = "blobs"
|
||||
DuplicatesBucket = "duplicates"
|
||||
OriginalBucket = "original"
|
||||
DBExtensionName = ".db"
|
||||
DBCacheLockCheckTimeout = 10 * time.Second
|
||||
BoltdbName = "cache"
|
||||
ReferrerFilterAnnotation = "org.opencontainers.referrers.filtersApplied"
|
||||
DynamoDBDriverName = "dynamodb"
|
||||
DefaultGCDelay = 1 * time.Hour
|
||||
S3StorageDriverName = "s3"
|
||||
BlobUploadDir = ".uploads"
|
||||
SchemaVersion = 2
|
||||
DefaultFilePerms = 0o600
|
||||
DefaultDirPerms = 0o700
|
||||
RLOCK = "RLock"
|
||||
RWLOCK = "RWLock"
|
||||
BlobsCache = "blobs"
|
||||
DuplicatesBucket = "duplicates"
|
||||
OriginalBucket = "original"
|
||||
DBExtensionName = ".db"
|
||||
DBCacheLockCheckTimeout = 10 * time.Second
|
||||
BoltdbName = "cache"
|
||||
DynamoDBDriverName = "dynamodb"
|
||||
DefaultGCDelay = 1 * time.Hour
|
||||
S3StorageDriverName = "s3"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue