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