Skip to content

Commit 2202d6d

Browse files
authored
fix: revert "org.opencontainers.referrers.filtersApplied" (#1478)
As per latest dist-spec, this is now removed. Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
1 parent a3f355c commit 2202d6d

2 files changed

Lines changed: 15 additions & 42 deletions

File tree

pkg/storage/common/common.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -560,26 +560,6 @@ func GetOrasReferrers(imgStore storageTypes.ImageStore, repo string, gdigest god
560560
return result, nil
561561
}
562562

563-
func getReferrerFilterAnnotation(artifactTypes []string) string {
564-
// as per spec, return what filters were applied as an annotation if artifactTypes
565-
annotation := ""
566-
567-
for _, artifactType := range artifactTypes {
568-
if artifactType == "" {
569-
// ignore empty artifactTypes
570-
continue
571-
}
572-
573-
if annotation == "" {
574-
annotation = artifactType
575-
} else {
576-
annotation += "," + artifactType
577-
}
578-
}
579-
580-
return annotation
581-
}
582-
583563
func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godigest.Digest, artifactTypes []string,
584564
log zerolog.Logger,
585565
) (ispec.Index, error) {
@@ -653,12 +633,6 @@ func GetReferrers(imgStore storageTypes.ImageStore, repo string, gdigest godiges
653633
Annotations: map[string]string{},
654634
}
655635

656-
// as per spec, return what filters were applied as an annotation if artifactTypes
657-
if annotation := getReferrerFilterAnnotation(artifactTypes); annotation != "" {
658-
index.Annotations[storageConstants.ReferrerFilterAnnotation] = annotation
659-
log.Info().Str("annotation", annotation).Msg("filters applied")
660-
}
661-
662636
return index, nil
663637
}
664638

pkg/storage/constants/constants.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ import (
66

77
const (
88
// BlobUploadDir defines the upload directory for blob uploads.
9-
BlobUploadDir = ".uploads"
10-
SchemaVersion = 2
11-
DefaultFilePerms = 0o600
12-
DefaultDirPerms = 0o700
13-
RLOCK = "RLock"
14-
RWLOCK = "RWLock"
15-
BlobsCache = "blobs"
16-
DuplicatesBucket = "duplicates"
17-
OriginalBucket = "original"
18-
DBExtensionName = ".db"
19-
DBCacheLockCheckTimeout = 10 * time.Second
20-
BoltdbName = "cache"
21-
ReferrerFilterAnnotation = "org.opencontainers.referrers.filtersApplied"
22-
DynamoDBDriverName = "dynamodb"
23-
DefaultGCDelay = 1 * time.Hour
24-
S3StorageDriverName = "s3"
9+
BlobUploadDir = ".uploads"
10+
SchemaVersion = 2
11+
DefaultFilePerms = 0o600
12+
DefaultDirPerms = 0o700
13+
RLOCK = "RLock"
14+
RWLOCK = "RWLock"
15+
BlobsCache = "blobs"
16+
DuplicatesBucket = "duplicates"
17+
OriginalBucket = "original"
18+
DBExtensionName = ".db"
19+
DBCacheLockCheckTimeout = 10 * time.Second
20+
BoltdbName = "cache"
21+
DynamoDBDriverName = "dynamodb"
22+
DefaultGCDelay = 1 * time.Hour
23+
S3StorageDriverName = "s3"
2524
)

0 commit comments

Comments
 (0)