getManifest from the local store, and fallback to the remote registry if it doesn't exist locally
(ctx context.Context, dockerCLI command.Cli, listRef, namedRef reference.Named, insecure bool)
| 70 | // getManifest from the local store, and fallback to the remote registry if it |
| 71 | // doesn't exist locally |
| 72 | func getManifest(ctx context.Context, dockerCLI command.Cli, listRef, namedRef reference.Named, insecure bool) (types.ImageManifest, error) { |
| 73 | data, err := newManifestStore(dockerCLI).Get(listRef, namedRef) |
| 74 | switch { |
| 75 | case errdefs.IsNotFound(err): |
| 76 | return newRegistryClient(dockerCLI, insecure).GetManifest(ctx, namedRef) |
| 77 | case err != nil: |
| 78 | return types.ImageManifest{}, err |
| 79 | case len(data.Raw) == 0: |
| 80 | return newRegistryClient(dockerCLI, insecure).GetManifest(ctx, namedRef) |
| 81 | default: |
| 82 | return data, nil |
| 83 | } |
| 84 | } |
no test coverage detected
searching dependent graphs…