MCPcopy
hub / github.com/containerd/containerd / WithTransaction

Function WithTransaction

core/metadata/boltutil/context.go:31–33  ·  view source on GitHub ↗

WithTransaction returns a new context holding the provided bolt transaction. Functions which require a bolt transaction will first check to see if a transaction is already created on the context before creating their own.

(ctx context.Context, tx *bolt.Tx)

Source from the content-addressed store, hash-verified

29// first check to see if a transaction is already created on the
30// context before creating their own.
31func WithTransaction(ctx context.Context, tx *bolt.Tx) context.Context {
32 return context.WithValue(ctx, transactionKey{}, tx)
33}
34
35// Transaction returns the transaction from the context
36// if it has one.

Callers 9

FuzzLeaseManagerFunction · 0.92
FuzzContainerStoreFunction · 0.92
TestLeasesFunction · 0.92
TestLeasesListFunction · 0.92
TestLeaseResourceFunction · 0.92
TestContainersListFunction · 0.92
createFunction · 0.92
initFunction · 0.92
withStoreMethod · 0.92

Calls

no outgoing calls

Tested by 7

FuzzLeaseManagerFunction · 0.74
FuzzContainerStoreFunction · 0.74
TestLeasesFunction · 0.74
TestLeasesListFunction · 0.74
TestLeaseResourceFunction · 0.74
TestContainersListFunction · 0.74
createFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…