MCPcopy
hub / github.com/containerd/containerd / checkAndDoUnpack

Function checkAndDoUnpack

integration/client/container_fuzz_test.go:245–253  ·  view source on GitHub ↗

checkAndDoUnpack checks if an image is unpacked. If it is not unpacked, then we may or may not unpack it. The fuzzer decides.

(ctx context.Context, image containerd.Image, f *fuzz.ConsumeFuzzer)

Source from the content-addressed store, hash-verified

243// If it is not unpacked, then we may or may not
244// unpack it. The fuzzer decides.
245func checkAndDoUnpack(ctx context.Context, image containerd.Image, f *fuzz.ConsumeFuzzer) {
246 unpacked, err := image.IsUnpacked(ctx, testSnapshotter)
247 if err == nil && unpacked {
248 shouldUnpack, err := f.GetBool()
249 if err == nil && shouldUnpack {
250 _ = image.Unpack(ctx, testSnapshotter)
251 }
252 }
253}
254
255// getImage() returns an image from the client.
256// The fuzzer decides which image is returned.

Callers 1

newContainerFunction · 0.85

Calls 2

IsUnpackedMethod · 0.65
UnpackMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…