MCPcopy
hub / github.com/containerd/containerd / getImage

Function getImage

integration/client/container_fuzz_test.go:257–269  ·  view source on GitHub ↗

getImage() returns an image from the client. The fuzzer decides which image is returned.

(client *containerd.Client, f *fuzz.ConsumeFuzzer)

Source from the content-addressed store, hash-verified

255// getImage() returns an image from the client.
256// The fuzzer decides which image is returned.
257func getImage(client *containerd.Client, f *fuzz.ConsumeFuzzer) (containerd.Image, error) {
258 images, err := client.ListImages(context.Background())
259 if err != nil {
260 return nil, err
261 }
262 imageIndex, err := f.GetInt()
263 if err != nil {
264 return nil, err
265 }
266 image := images[imageIndex%len(images)]
267 return image, nil
268
269}
270
271// newContainer creates and returns a container
272// The fuzzer decides how the container is created

Callers 1

newContainerFunction · 0.85

Calls 1

ListImagesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…