added attach attempt on failed read
This commit is contained in:
parent
6c944ce6a7
commit
e0bbfc9a24
@ -544,9 +544,11 @@ func (con Connection) AttachServer(ctx *gin.Context) {
|
||||
}
|
||||
count, err := hijacked.Reader.Read(data)
|
||||
if err != nil {
|
||||
log.Printf("Read from docker failed %s", errors.Unwrap(err))
|
||||
stop = true
|
||||
break
|
||||
hijacked, err = con.dockerClient.ContainerAttach(context.TODO(), containers[0].ID, container.AttachOptions{Stream: true, Stdin: true, Stdout: true, Stderr: true, Logs: true})
|
||||
if err != nil {
|
||||
stop = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
containerRead <- string(data[:count])
|
||||
|
Loading…
x
Reference in New Issue
Block a user