manifestDigest returns a digest of the manifest, from instanceDigest if non-nil; or from the supplied reference, or finally, from a fetched manifest.
(ctx context.Context, instanceDigest *digest.Digest)
| 488 | // manifestDigest returns a digest of the manifest, from instanceDigest if non-nil; or from the supplied reference, |
| 489 | // or finally, from a fetched manifest. |
| 490 | func (s *dockerImageSource) manifestDigest(ctx context.Context, instanceDigest *digest.Digest) (digest.Digest, error) { |
| 491 | if instanceDigest != nil { |
| 492 | return *instanceDigest, nil |
| 493 | } |
| 494 | if digested, ok := s.physicalRef.ref.(reference.Digested); ok { |
| 495 | d := digested.Digest() |
| 496 | if d.Algorithm() == digest.Canonical { |
| 497 | return d, nil |
| 498 | } |
| 499 | } |
| 500 | if err := s.ensureManifestIsLoaded(ctx); err != nil { |
| 501 | return "", err |
| 502 | } |
| 503 | return manifest.Digest(s.cachedManifest) |
| 504 | } |
| 505 | |
| 506 | // appendSignaturesFromLookaside implements GetSignaturesWithFormat() from the lookaside location configured in s.c.signatureBase, |
| 507 | // which is not nil, storing the signatures to *dest. |
no test coverage detected