(ctx context.Context)
| 227 | } |
| 228 | |
| 229 | func (i *image) Spec(ctx context.Context) (ocispec.Image, error) { |
| 230 | var ociImage ocispec.Image |
| 231 | |
| 232 | desc, err := i.Config(ctx) |
| 233 | if err != nil { |
| 234 | return ociImage, fmt.Errorf("get image config descriptor: %w", err) |
| 235 | } |
| 236 | |
| 237 | blob, err := content.ReadBlob(ctx, i.ContentStore(), desc) |
| 238 | if err != nil { |
| 239 | return ociImage, fmt.Errorf("read image config from content store: %w", err) |
| 240 | } |
| 241 | |
| 242 | if err := json.Unmarshal(blob, &ociImage); err != nil { |
| 243 | return ociImage, fmt.Errorf("unmarshal image config %s: %w", blob, err) |
| 244 | } |
| 245 | |
| 246 | return ociImage, nil |
| 247 | } |
| 248 | |
| 249 | // UnpackConfig provides configuration for the unpack of an image |
| 250 | type UnpackConfig struct { |
nothing calls this directly
no test coverage detected