MCPcopy Create free account
hub / github.com/containerd/containerd / copyDistributionSourceLabels

Function copyDistributionSourceLabels

core/remotes/handlers.go:404–420  ·  view source on GitHub ↗
(from map[string]string, to *ocispec.Descriptor)

Source from the content-addressed store, hash-verified

402}
403
404func copyDistributionSourceLabels(from map[string]string, to *ocispec.Descriptor) {
405 for k, v := range from {
406 if !strings.HasPrefix(k, labels.LabelDistributionSource+".") {
407 continue
408 }
409
410 if to.Annotations == nil {
411 to.Annotations = make(map[string]string)
412 } else {
413 // Only propagate the parent label if the child doesn't already have it.
414 if _, has := to.Annotations[k]; has {
415 continue
416 }
417 }
418 to.Annotations[k] = v
419 }
420}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…