37 lines
1.7 KiB
Go
37 lines
1.7 KiB
Go
package dockerclient
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors returned by the production adapter and consumed by
|
|
// `internal/runtime`. Tests substitute their own implementations of
|
|
// Client and may return these sentinels verbatim or wrap them with
|
|
// extra context via fmt.Errorf("...: %w", ...).
|
|
var (
|
|
// ErrNetworkMissing is returned by EnsureNetwork when the configured
|
|
// user-defined Docker network does not exist on the daemon.
|
|
// `internal/runtime` treats this as a fatal startup error — Galaxy
|
|
// never creates Docker networks itself.
|
|
ErrNetworkMissing = errors.New("dockerclient: network missing")
|
|
|
|
// ErrImageNotFound is returned by InspectImage / PullImage(never)
|
|
// when the image is absent locally and the active pull policy
|
|
// forbids fetching it.
|
|
ErrImageNotFound = errors.New("dockerclient: image not found")
|
|
|
|
// ErrContainerNotFound is returned by InspectContainer / Stop /
|
|
// Remove when no container with the supplied id or name exists.
|
|
// `internal/runtime` treats this as an idempotent miss for Stop and
|
|
// Remove and as a removed-container signal for InspectContainer.
|
|
ErrContainerNotFound = errors.New("dockerclient: container not found")
|
|
|
|
// ErrInvalidPullPolicy is returned by Run / PullImage when the
|
|
// supplied PullPolicy is not part of the closed vocabulary.
|
|
ErrInvalidPullPolicy = errors.New("dockerclient: invalid pull policy")
|
|
|
|
// ErrImagePullFailed wraps every PullImage failure path returned to
|
|
// the caller so `internal/runtime` can attribute the failure to the
|
|
// pull stage rather than to container creation. The unwrap chain
|
|
// preserves the underlying daemon error for logs and metrics.
|
|
ErrImagePullFailed = errors.New("dockerclient: image pull failed")
|
|
)
|