ContainerUpdate updates configuration of the container
(name string, hostConfig *container.HostConfig)
| 12 | |
| 13 | // ContainerUpdate updates configuration of the container |
| 14 | func (daemon *Daemon) ContainerUpdate(name string, hostConfig *container.HostConfig) (container.UpdateResponse, error) { |
| 15 | var warnings []string |
| 16 | |
| 17 | daemonCfg := daemon.config() |
| 18 | warnings, err := daemon.verifyContainerSettings(daemonCfg, hostConfig, nil, true) |
| 19 | if err != nil { |
| 20 | return container.UpdateResponse{Warnings: warnings}, errdefs.InvalidParameter(err) |
| 21 | } |
| 22 | |
| 23 | if err := daemon.update(name, hostConfig); err != nil { |
| 24 | return container.UpdateResponse{Warnings: warnings}, err |
| 25 | } |
| 26 | |
| 27 | return container.UpdateResponse{Warnings: warnings}, nil |
| 28 | } |
| 29 | |
| 30 | func (daemon *Daemon) update(name string, hostConfig *container.HostConfig) error { |
| 31 | if hostConfig == nil { |
nothing calls this directly
no test coverage detected