mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon: replace ErrRootFSReadOnly with errdefs
It was only used in a single location, and the ErrRootFSReadOnly was not checked
for, or used as a sentinel error.
This error was introduced in c32dde5baa
, originally
named `ErrContainerRootfsReadonly`. It was never used as a sentinel error, but
from that commit, it looks like it was added as a package variable to mirror
the coding style of already existing errors defined at the package level.
This patch removes the exported variable, and replaces the error with an
errdefs.InvalidParameter(), so that the API also returns the correct (400)
status code.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
e31e9180cd
commit
0f1eeed5c2
2 changed files with 1 additions and 5 deletions
|
@ -326,7 +326,7 @@ func (daemon *Daemon) containerExtractToDir(container *container.Container, path
|
|||
}
|
||||
|
||||
if !toVolume && container.HostConfig.ReadonlyRootfs {
|
||||
return ErrRootFSReadOnly
|
||||
return errdefs.InvalidParameter(errors.New("container rootfs is marked read-only"))
|
||||
}
|
||||
|
||||
options := daemon.defaultTarCopyOptions(noOverwriteDirNonDir)
|
||||
|
|
|
@ -26,10 +26,6 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ErrRootFSReadOnly is returned when a container
|
||||
// rootfs is marked readonly.
|
||||
var ErrRootFSReadOnly = errors.New("container rootfs is marked read-only")
|
||||
|
||||
func (daemon *Daemon) getDNSSearchSettings(container *container.Container) []string {
|
||||
if len(container.HostConfig.DNSSearch) > 0 {
|
||||
return container.HostConfig.DNSSearch
|
||||
|
|
Loading…
Add table
Reference in a new issue