MCPcopy Index your code
hub / github.com/docker/docker-agent / WithAutoInjector

Function WithAutoInjector

pkg/runtime/runtime.go:528–534  ·  view source on GitHub ↗

WithAutoInjector adds an [builtins.AutoInjector] that augments every per-agent hook configuration during executor build. The canonical use case is the snapshot controller returned by [builtins.RegisterSnapshot]: pass the same controller to the App via app.WithSnapshotController so /undo and friends

(inj builtins.AutoInjector)

Source from the content-addressed store, hash-verified

526//
527// Multiple calls accumulate; injectors run in registration order.
528func WithAutoInjector(inj builtins.AutoInjector) Opt {
529 return func(r *LocalRuntime) {
530 if inj != nil {
531 r.autoInjectors = append(r.autoInjectors, inj)
532 }
533 }
534}
535
536// WithHooksRegistry plugs a pre-populated [hooks.Registry] into the
537// runtime instead of letting it allocate a fresh one. Embedders use

Callers 1

snapshotRuntimeOptsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected