This file contains helper functions to convert docker API types to runtime API types, or vice versa.
(image *dockertypes.ImageSummary, pinned bool)
| 38 | // API types, or vice versa. |
| 39 | |
| 40 | func 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 | |
| 54 | func imageInspectToRuntimeAPIImage(image *dockertypes.ImageInspect, pinned bool) (*runtimeapi.Image, error) { |
| 55 | if image == nil || image.Config == nil { |
no outgoing calls
no test coverage detected
searching dependent graphs…