MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / imageToRuntimeAPIImage

Function imageToRuntimeAPIImage

core/convert.go:40–52  ·  view source on GitHub ↗

This file contains helper functions to convert docker API types to runtime API types, or vice versa.

(image *dockertypes.ImageSummary, pinned bool)

Source from the content-addressed store, hash-verified

38// API types, or vice versa.
39
40func imageToRuntimeAPIImage(image *dockertypes.ImageSummary, pinned bool) (*runtimeapi.Image, error) {
41 if image == nil {
42 return nil, fmt.Errorf("unable to convert a nil pointer to a runtime API image")
43 }
44
45 return &runtimeapi.Image{
46 Id: image.ID,
47 RepoTags: image.RepoTags,
48 RepoDigests: image.RepoDigests,
49 Size_: uint64(image.Size),
50 Pinned: pinned,
51 }, nil
52}
53
54func imageInspectToRuntimeAPIImage(image *dockertypes.ImageInspect, pinned bool) (*runtimeapi.Image, error) {
55 if image == nil || image.Config == nil {

Callers 1

ListImagesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…