mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/*.go: fix some Wrap[f]/Warn[f] errors
In particular, these two: > daemon/daemon_unix.go:1129: Wrapf format %v reads arg #1, but call has 0 args > daemon/kill.go:111: Warn call has possible formatting directive %s and a few more. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
94a8f4d0d4
commit
3737194b9f
6 changed files with 10 additions and 10 deletions
|
@ -538,7 +538,7 @@ func (daemon *Daemon) DaemonLeavesCluster() {
|
||||||
select {
|
select {
|
||||||
case <-done:
|
case <-done:
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(5 * time.Second):
|
||||||
logrus.Warnf("timeout while waiting for ingress network removal")
|
logrus.Warn("timeout while waiting for ingress network removal")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logrus.Warnf("failed to initiate ingress network removal: %v", err)
|
logrus.Warnf("failed to initiate ingress network removal: %v", err)
|
||||||
|
|
|
@ -646,13 +646,13 @@ func (daemon *Daemon) initRuntimes(runtimes map[string]types.Runtime) (err error
|
||||||
os.RemoveAll(runtimeDir + "-old")
|
os.RemoveAll(runtimeDir + "-old")
|
||||||
tmpDir, err := ioutils.TempDir(daemon.configStore.Root, "gen-runtimes")
|
tmpDir, err := ioutils.TempDir(daemon.configStore.Root, "gen-runtimes")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "failed to get temp dir to generate runtime scripts")
|
return errors.Wrap(err, "failed to get temp dir to generate runtime scripts")
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err1 := os.RemoveAll(tmpDir); err1 != nil {
|
if err1 := os.RemoveAll(tmpDir); err1 != nil {
|
||||||
logrus.WithError(err1).WithField("dir", tmpDir).
|
logrus.WithError(err1).WithField("dir", tmpDir).
|
||||||
Warnf("failed to remove tmp dir")
|
Warn("failed to remove tmp dir")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -661,12 +661,12 @@ func (daemon *Daemon) initRuntimes(runtimes map[string]types.Runtime) (err error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err = os.Rename(tmpDir, runtimeDir); err != nil {
|
if err = os.Rename(tmpDir, runtimeDir); err != nil {
|
||||||
err = errors.Wrapf(err, "failed to setup runtimes dir, new containers may not start")
|
err = errors.Wrap(err, "failed to setup runtimes dir, new containers may not start")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err = os.RemoveAll(runtimeDir + "-old"); err != nil {
|
if err = os.RemoveAll(runtimeDir + "-old"); err != nil {
|
||||||
logrus.WithError(err).WithField("dir", tmpDir).
|
logrus.WithError(err).WithField("dir", tmpDir).
|
||||||
Warnf("failed to remove old runtimes dir")
|
Warn("failed to remove old runtimes dir")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -1126,7 +1126,7 @@ func setupRemappedRoot(config *config.Config) (*idtools.IDMappings, error) {
|
||||||
|
|
||||||
mappings, err := idtools.NewIDMappings(username, groupname)
|
mappings, err := idtools.NewIDMappings(username, groupname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "Can't create ID mappings: %v")
|
return nil, errors.Wrap(err, "Can't create ID mappings")
|
||||||
}
|
}
|
||||||
return mappings, nil
|
return mappings, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, sig int)
|
||||||
if unpause {
|
if unpause {
|
||||||
// above kill signal will be sent once resume is finished
|
// above kill signal will be sent once resume is finished
|
||||||
if err := daemon.containerd.Resume(context.Background(), container.ID); err != nil {
|
if err := daemon.containerd.Resume(context.Background(), container.ID); err != nil {
|
||||||
logrus.Warn("Cannot unpause container %s: %s", container.ID, err)
|
logrus.Warnf("Cannot unpause container %s: %s", container.ID, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc
|
||||||
"container": c.ID,
|
"container": c.ID,
|
||||||
"exec-id": ei.ProcessID,
|
"exec-id": ei.ProcessID,
|
||||||
"exec-pid": ei.Pid,
|
"exec-pid": ei.Pid,
|
||||||
}).Warnf("Ignoring Exit Event, no such exec command found")
|
}).Warn("Ignoring Exit Event, no such exec command found")
|
||||||
}
|
}
|
||||||
case libcontainerd.EventStart:
|
case libcontainerd.EventStart:
|
||||||
c.Lock()
|
c.Lock()
|
||||||
|
|
|
@ -186,7 +186,7 @@ func (daemon *Daemon) reloadClusterDiscovery(conf *config.Config, attributes map
|
||||||
}
|
}
|
||||||
netOptions, err := daemon.networkOptions(daemon.configStore, daemon.PluginStore, nil)
|
netOptions, err := daemon.networkOptions(daemon.configStore, daemon.PluginStore, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Warnf("failed to get options with network controller")
|
logrus.WithError(err).Warn("failed to get options with network controller")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
err = daemon.netController.ReloadConfiguration(netOptions...)
|
err = daemon.netController.ReloadConfiguration(netOptions...)
|
||||||
|
|
|
@ -37,7 +37,7 @@ func (daemon *Daemon) containerUnpause(container *container.Container) error {
|
||||||
daemon.LogContainerEvent(container, "unpause")
|
daemon.LogContainerEvent(container, "unpause")
|
||||||
|
|
||||||
if err := container.CheckpointTo(daemon.containersReplica); err != nil {
|
if err := container.CheckpointTo(daemon.containersReplica); err != nil {
|
||||||
logrus.WithError(err).Warnf("could not save container to disk")
|
logrus.WithError(err).Warn("could not save container to disk")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue