mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
20 lines
403 B
Go
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() {}
|