MCPcopy
hub / github.com/containerd/containerd / checkRefNotAvailable

Function checkRefNotAvailable

core/content/testsuite/testsuite.go:353–364  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, cs content.Store, ref string)

Source from the content-addressed store, hash-verified

351}
352
353func checkRefNotAvailable(ctx context.Context, t *testing.T, cs content.Store, ref string) {
354 t.Helper()
355
356 w, err := cs.Writer(ctx, content.WithRef(ref))
357 if err == nil {
358 defer w.Close()
359 t.Fatal("writer created with ref, expected to be in use")
360 }
361 if !errdefs.IsUnavailable(err) {
362 t.Fatalf("Expected unavailable error, got %+v", err)
363 }
364}
365
366func discardWriter(t *testing.T, w content.Writer) {
367 if err := w.Truncate(0); err != nil {

Callers 1

checkCommitErrorStateFunction · 0.85

Calls 4

WithRefFunction · 0.92
FatalMethod · 0.80
WriterMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…