remove Register return value#30753
Conversation
Since Register() will never return err,remove the return value Signed-off-by: NickrenREN <yuquan.ren@easystack.cn>
72bde6a to
78b50c1
Compare
| @@ -98,8 +98,6 @@ func (daemon *Daemon) Register(c *container.Container) error { | ||
|
|
||
| daemon.containers.Add(c.ID, c) | ||
| daemon.idIndex.Add(c.ID) |
There was a problem hiding this comment.
Looking at these, it appears that we're ignoring any error that can occur when adding to the index; https://github.com/docker/docker/blob/fe9f5610c49b1a6ca2ebbb68c1478fc7f106eaa8/pkg/truncindex/truncindex.go#L59-L81
wondering if we should actually return those errors instead
/cc @cpuguy83
There was a problem hiding this comment.
I would say we've never checked errors here before, and the errors that could be produced are already checked earlier on before we send to truncindex.
The only really valid error is if something couldn't be inserted, but in the end is not actionable to the user, and does not affect the operation of the container in anyway, just lookup by prefix.
It probably wouldn't hurt, but it won't help either.
Since Register() will never return err,remove the return value