MCPcopy
hub / github.com/moby/moby / ContainerUpdate

Method ContainerUpdate

daemon/update.go:14–28  ·  view source on GitHub ↗

ContainerUpdate updates configuration of the container

(name string, hostConfig *container.HostConfig)

Source from the content-addressed store, hash-verified

12
13// ContainerUpdate updates configuration of the container
14func (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
30func (daemon *Daemon) update(name string, hostConfig *container.HostConfig) error {
31 if hostConfig == nil {

Callers

nothing calls this directly

Calls 4

configMethod · 0.95
updateMethod · 0.95
InvalidParameterFunction · 0.92

Tested by

no test coverage detected