0
Fork 0
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:
Ramkumar Chinchani 2023-05-26 13:56:44 -07:00 committed by GitHub
parent a3f355c278
commit 2202d6dfd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 42 deletions

View file

@ -560,26 +560,6 @@ func GetOrasReferrers(imgStore storageTypes.ImageStore, repo string, gdigest god
return result, nil 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, func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godigest.Digest, artifactTypes []string,
log zerolog.Logger, log zerolog.Logger,
) (ispec.Index, error) { ) (ispec.Index, error) {
@ -653,12 +633,6 @@ func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godiges
Annotations: map[string]string{}, 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 return index, nil
} }

View file

@ -6,20 +6,19 @@ import (
const ( const (
// BlobUploadDir defines the upload directory for blob uploads. // BlobUploadDir defines the upload directory for blob uploads.
BlobUploadDir = ".uploads" BlobUploadDir = ".uploads"
SchemaVersion = 2 SchemaVersion = 2
DefaultFilePerms = 0o600 DefaultFilePerms = 0o600
DefaultDirPerms = 0o700 DefaultDirPerms = 0o700
RLOCK = "RLock" RLOCK = "RLock"
RWLOCK = "RWLock" RWLOCK = "RWLock"
BlobsCache = "blobs" BlobsCache = "blobs"
DuplicatesBucket = "duplicates" DuplicatesBucket = "duplicates"
OriginalBucket = "original" OriginalBucket = "original"
DBExtensionName = ".db" DBExtensionName = ".db"
DBCacheLockCheckTimeout = 10 * time.Second DBCacheLockCheckTimeout = 10 * time.Second
BoltdbName = "cache" BoltdbName = "cache"
ReferrerFilterAnnotation = "org.opencontainers.referrers.filtersApplied" DynamoDBDriverName = "dynamodb"
DynamoDBDriverName = "dynamodb" DefaultGCDelay = 1 * time.Hour
DefaultGCDelay = 1 * time.Hour S3StorageDriverName = "s3"
S3StorageDriverName = "s3"
) )