MCPcopy
hub / github.com/containerd/containerd / createLease

Function createLease

core/metadata/content_test.go:178–188  ·  view source on GitHub ↗
(ctx context.Context, db *DB, name string)

Source from the content-addressed store, hash-verified

176}
177
178func createLease(ctx context.Context, db *DB, name string) (context.Context, func() error, error) {
179 lm := NewLeaseManager(db)
180 if _, err := lm.Create(ctx, leases.WithID(name)); err != nil {
181 return nil, nil, err
182 }
183 return leases.WithLease(ctx, name), func() error {
184 return lm.Delete(ctx, leases.Lease{
185 ID: name,
186 })
187 }, nil
188}
189
190func checkContentLeased(ctx context.Context, db *DB, dgst digest.Digest) error {
191 ns, ok := namespaces.Namespace(ctx)

Callers 2

TestContentLeasedFunction · 0.85
TestIngestLeasedFunction · 0.85

Calls 5

WithIDFunction · 0.92
WithLeaseFunction · 0.92
NewLeaseManagerFunction · 0.70
CreateMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…