MCPcopy Index your code
hub / github.com/containerd/containerd / isSharedContent

Function isSharedContent

core/metadata/content.go:757–775  ·  view source on GitHub ↗
(tx *bolt.Tx, dgst digest.Digest)

Source from the content-addressed store, hash-verified

755}
756
757func isSharedContent(tx *bolt.Tx, dgst digest.Digest) bool {
758 v1bkt := tx.Bucket(bucketKeyVersion)
759 if v1bkt == nil {
760 return false
761 }
762 // iterate through each namespace
763 v1c := v1bkt.Cursor()
764 for nk, _ := v1c.First(); nk != nil; nk, _ = v1c.Next() {
765 ns := string(nk)
766 lbkt := getNamespaceLabelsBucket(tx, ns)
767 if lbkt == nil {
768 continue
769 }
770 if sharedNS := lbkt.Get([]byte(labels.LabelSharedNamespace)); sharedNS != nil && string(sharedNS) == "true" && getBlobBucket(tx, ns, dgst) != nil {
771 return true
772 }
773 }
774 return false
775}
776
777func validateInfo(info *content.Info) error {
778 for k, v := range info.Labels {

Callers 1

WriterMethod · 0.85

Calls 3

getNamespaceLabelsBucketFunction · 0.85
getBlobBucketFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…