Workaround for #819.
(h v1.Hash)
| 128 | |
| 129 | // Workaround for #819. |
| 130 | func (r *remoteIndex) Layer(h v1.Hash) (v1.Layer, error) { |
| 131 | index, err := r.IndexManifest() |
| 132 | if err != nil { |
| 133 | return nil, err |
| 134 | } |
| 135 | for _, childDesc := range index.Manifests { |
| 136 | if h == childDesc.Digest { |
| 137 | l, err := partial.CompressedToLayer(&remoteLayer{ |
| 138 | fetcher: r.fetcher, |
| 139 | ctx: r.ctx, |
| 140 | digest: h, |
| 141 | }) |
| 142 | if err != nil { |
| 143 | return nil, err |
| 144 | } |
| 145 | return &MountableLayer{ |
| 146 | Layer: l, |
| 147 | Reference: r.ref.Context().Digest(h.String()), |
| 148 | }, nil |
| 149 | } |
| 150 | } |
| 151 | return nil, fmt.Errorf("layer not found: %s", h) |
| 152 | } |
| 153 | |
| 154 | func (r *remoteIndex) imageByPlatform(platform v1.Platform) (v1.Image, error) { |
| 155 | desc, err := r.childByPlatform(platform) |
nothing calls this directly
no test coverage detected