(from map[string]string, to *ocispec.Descriptor)
| 402 | } |
| 403 | |
| 404 | func 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…