MCPcopy
hub / github.com/containerd/containerd / DeferContext

Function DeferContext

internal/cri/util/util.go:52–54  ·  view source on GitHub ↗

DeferContext returns a context for containerd cleanup operations in defer. A configurable default timeout is applied to avoid cleanup operation pending forever.

()

Source from the content-addressed store, hash-verified

50// DeferContext returns a context for containerd cleanup operations in defer.
51// A configurable default timeout is applied to avoid cleanup operation pending forever.
52func DeferContext() (context.Context, context.CancelFunc) {
53 return context.WithTimeout(NamespacedContext(), timeout.Get(deferCleanupTimeoutKey))
54}
55
56// NamespacedContext returns a context with kubernetes namespace set.
57func NamespacedContext() context.Context {

Callers 3

createContainerMethod · 0.92
RunPodSandboxMethod · 0.92
execInternalMethod · 0.92

Calls 2

GetFunction · 0.92
NamespacedContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…