Files
moby/daemon/internal/runconfig/errors.go
Sebastiaan van Stijn f78d595c96 runconfig: move to daemon/internal/runconfig
The runconfig package is used by the "container" router to unmarshal, normalize,
and validate a container.CreateRequest. The router converts the result to a
backend.ContainerCreateConfig to be passed on to the backend (daemon).

This package could possibly be part of the router itself, or moved to an
internal package in the server, but we don't have an internal package
there yet.

Put it in daemon/internal for now, which still leaves our options open.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:15 +02:00

20 lines
403 B
Go

package runconfig
import cerrdefs "github.com/containerd/errdefs"
func validationError(msg string) error {
return cerrdefs.ErrInvalidArgument.WithMessage(msg)
}
type invalidJSONError struct{ error }
func (e invalidJSONError) Error() string {
return "invalid JSON: " + e.error.Error()
}
func (e invalidJSONError) Unwrap() error {
return e.error
}
func (e invalidJSONError) InvalidParameter() {}