GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). It may use a remote (= slow) service. If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary m
(ctx context.Context, instanceDigest *digest.Digest)
| 225 | // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); |
| 226 | // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). |
| 227 | func (s *dockerImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { |
| 228 | if instanceDigest != nil { |
| 229 | if err := instanceDigest.Validate(); err != nil { // Make sure instanceDigest.String() does not contain any unexpected characters |
| 230 | return nil, "", err |
| 231 | } |
| 232 | return s.fetchManifest(ctx, instanceDigest.String()) |
| 233 | } |
| 234 | err := s.ensureManifestIsLoaded(ctx) |
| 235 | if err != nil { |
| 236 | return nil, "", err |
| 237 | } |
| 238 | return s.cachedManifest, s.cachedManifestMIMEType, nil |
| 239 | } |
| 240 | |
| 241 | // fetchManifest fetches a manifest for tagOrDigest. |
| 242 | // The caller is responsible for ensuring tagOrDigest uses the expected format. |
nothing calls this directly
no test coverage detected