mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
fix: avoid race condition by not running exec/start twice
This commit is contained in:
parent
76f9cea516
commit
9505cd5d4a
2 changed files with 0 additions and 16 deletions
|
|
@ -463,13 +463,6 @@ func (client dockerClient) ExecuteCommand(containerID t.ContainerID, command str
|
||||||
clog.Errorf("Failed to extract command exec logs: %v", attachErr)
|
clog.Errorf("Failed to extract command exec logs: %v", attachErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the exec
|
|
||||||
execStartCheck := types.ExecStartCheck{Detach: false, Tty: true}
|
|
||||||
err = client.api.ContainerExecStart(bg, exec.ID, execStartCheck)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var output string
|
var output string
|
||||||
if attachErr == nil {
|
if attachErr == nil {
|
||||||
defer response.Close()
|
defer response.Close()
|
||||||
|
|
|
||||||
|
|
@ -282,15 +282,6 @@ var _ = Describe("the client", func() {
|
||||||
}),
|
}),
|
||||||
ghttp.RespondWithJSONEncoded(http.StatusOK, types.IDResponse{ID: execID}),
|
ghttp.RespondWithJSONEncoded(http.StatusOK, types.IDResponse{ID: execID}),
|
||||||
),
|
),
|
||||||
// API.ContainerExecStart
|
|
||||||
ghttp.CombineHandlers(
|
|
||||||
ghttp.VerifyRequest("POST", HaveSuffix("exec/%v/start", execID)),
|
|
||||||
ghttp.VerifyJSONRepresenting(types.ExecStartCheck{
|
|
||||||
Detach: false,
|
|
||||||
Tty: true,
|
|
||||||
}),
|
|
||||||
ghttp.RespondWith(http.StatusOK, nil),
|
|
||||||
),
|
|
||||||
// API.ContainerExecInspect
|
// API.ContainerExecInspect
|
||||||
ghttp.CombineHandlers(
|
ghttp.CombineHandlers(
|
||||||
ghttp.VerifyRequest("GET", HaveSuffix("exec/ex-exec-id/json")),
|
ghttp.VerifyRequest("GET", HaveSuffix("exec/ex-exec-id/json")),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue