Refactor StartContainer, StopContainer and RemoveContainer.

This commit is contained in:
Random-Liu
2016-04-14 10:37:35 -07:00
parent ba4a5ed39e
commit d3d98b372b
7 changed files with 30 additions and 39 deletions

View File

@@ -76,16 +76,16 @@ func (in instrumentedDockerInterface) CreateContainer(opts dockertypes.Container
return out, err
}
func (in instrumentedDockerInterface) StartContainer(id string, hostConfig *docker.HostConfig) error {
func (in instrumentedDockerInterface) StartContainer(id string) error {
const operation = "start_container"
defer recordOperation(operation, time.Now())
err := in.client.StartContainer(id, hostConfig)
err := in.client.StartContainer(id)
recordError(operation, err)
return err
}
func (in instrumentedDockerInterface) StopContainer(id string, timeout uint) error {
func (in instrumentedDockerInterface) StopContainer(id string, timeout int) error {
const operation = "stop_container"
defer recordOperation(operation, time.Now())
@@ -94,11 +94,11 @@ func (in instrumentedDockerInterface) StopContainer(id string, timeout uint) err
return err
}
func (in instrumentedDockerInterface) RemoveContainer(opts docker.RemoveContainerOptions) error {
func (in instrumentedDockerInterface) RemoveContainer(id string, opts dockertypes.ContainerRemoveOptions) error {
const operation = "remove_container"
defer recordOperation(operation, time.Now())
err := in.client.RemoveContainer(opts)
err := in.client.RemoveContainer(id, opts)
recordError(operation, err)
return err
}