mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-24 06:28:42 +01:00
test: added test cases for container actions (#2559)
This commit is contained in:
@@ -149,14 +149,14 @@ func (d *Client) FindContainer(id string) (Container, error) {
|
||||
return container, nil
|
||||
}
|
||||
|
||||
func (d *Client) ContainerActions(action string, id string) error {
|
||||
func (d *Client) ContainerActions(action string, containerID string) error {
|
||||
switch action {
|
||||
case "start":
|
||||
return d.cli.ContainerStart(context.Background(), id, types.ContainerStartOptions{})
|
||||
return d.cli.ContainerStart(context.Background(), containerID, types.ContainerStartOptions{})
|
||||
case "stop":
|
||||
return d.cli.ContainerStop(context.Background(), id, container.StopOptions{})
|
||||
return d.cli.ContainerStop(context.Background(), containerID, container.StopOptions{})
|
||||
case "restart":
|
||||
return d.cli.ContainerRestart(context.Background(), id, container.StopOptions{})
|
||||
return d.cli.ContainerRestart(context.Background(), containerID, container.StopOptions{})
|
||||
default:
|
||||
return fmt.Errorf("unknown action: %s", action)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user