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

Function imageInspectToRuntimeAPIImage

core/convert.go:54–73  ·  view source on GitHub ↗
(image *dockertypes.ImageInspect, pinned bool)

Source from the content-addressed store, hash-verified

52}
53
54func imageInspectToRuntimeAPIImage(image *dockertypes.ImageInspect, pinned bool) (*runtimeapi.Image, error) {
55 if image == nil || image.Config == nil {
56 return nil, fmt.Errorf("unable to convert a nil pointer to a runtime API image")
57 }
58
59 runtimeImage := &runtimeapi.Image{
60 Id: image.ID,
61 RepoTags: image.RepoTags,
62 RepoDigests: image.RepoDigests,
63 Size_: uint64(image.Size),
64 Pinned: pinned,
65 }
66
67 uid, username := getUserFromImageUser(image.Config.User)
68 if uid != nil {
69 runtimeImage.Uid = &runtimeapi.Int64Value{Value: *uid}
70 }
71 runtimeImage.Username = username
72 return runtimeImage, nil
73}
74
75type verboseImageInfo struct {
76 Labels map[string]string `json:"labels,omitempty"`

Callers 1

ImageStatusMethod · 0.85

Calls 1

getUserFromImageUserFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…