Skip to content

Commit ad7d370

Browse files
authored
🌱 Ignore EOF error when closing ssh session. (#2005)
1 parent d3eef77 commit ad7d370

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/services/baremetal/client/ssh/ssh_client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"encoding/base64"
2626
"errors"
2727
"fmt"
28+
"io"
2829
"net"
2930
"os"
3031
"path/filepath"
@@ -668,7 +669,7 @@ func (c *sshClient) runSSH(ctx context.Context, command string) Output {
668669
return Output{Err: fmt.Errorf("unable to create new ssh session (%s): %w", c.connectionDetails(), err)}
669670
}
670671
defer func() {
671-
if err := sess.Close(); err != nil {
672+
if err := sess.Close(); err != nil && !errors.Is(err, io.EOF) {
672673
logger.Error(err, "failed to close ssh session")
673674
}
674675
}()

0 commit comments

Comments
 (0)