Merge pull request #8701 from djdongjin/gc

Remove unnecessary label bucket loop
This commit is contained in:
Kazuyoshi Kato 2023-06-20 11:20:20 -07:00 committed by GitHub
commit ad9d1a82f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -719,15 +719,8 @@ func isSharedContent(tx *bolt.Tx, dgst digest.Digest) bool {
if lbkt == nil { if lbkt == nil {
continue continue
} }
// iterate through each label if sharedNS := lbkt.Get([]byte(labels.LabelSharedNamespace)); sharedNS != nil && string(sharedNS) == "true" && getBlobBucket(tx, ns, dgst) != nil {
lbc := lbkt.Cursor() return true
for k, v := lbc.First(); k != nil; k, v = lbc.Next() {
if string(k) == labels.LabelSharedNamespace {
if string(v) == "true" && getBlobBucket(tx, ns, dgst) != nil {
return true
}
break
}
} }
} }
return false return false