mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: Daemon.getIpcContainer: make errors less repetitive
- Most error-message returned would already include "container" and the
container ID in the error-message (e.g. "container %s is not running"),
so there's no need to add a custom prefix for that.
- os.Stat returns a PathError, which already includes the operation ("stat"),
the path, and the underlying error that occurred.
And while updating, let's also fix the name to be proper camelCase :)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -292,9 +292,9 @@ func WithNamespaces(daemon *Daemon, c *container.Container) coci.SpecOpts {
|
||||
}
|
||||
switch {
|
||||
case ipcMode.IsContainer():
|
||||
ic, err := daemon.getIpcContainer(ipcMode.Container())
|
||||
ic, err := daemon.getIPCContainer(ipcMode.Container())
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "invalid IPC mode: %v", ipcMode)
|
||||
return errors.Wrap(err, "failed to join IPC namespace")
|
||||
}
|
||||
setNamespace(s, specs.LinuxNamespace{
|
||||
Type: specs.IPCNamespace,
|
||||
@@ -526,7 +526,7 @@ func withMounts(daemon *Daemon, daemonCfg *configStore, c *container.Container)
|
||||
return err
|
||||
}
|
||||
|
||||
if err := daemon.setupIpcDirs(c); err != nil {
|
||||
if err := daemon.setupIPCDirs(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user