Skip to content

Commit f5a1bb8

Browse files
committed
root: filter out commandConn.Close* warning message
Signed-off-by: CrazyMax <[email protected]>
1 parent 58c477f commit f5a1bb8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/compose/compose.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/compose-spec/compose-go/cli"
2929
"github.com/compose-spec/compose-go/types"
3030
composegoutils "github.com/compose-spec/compose-go/utils"
31+
"github.com/docker/buildx/util/logutil"
3132
dockercli "github.com/docker/cli/cli"
3233
"github.com/docker/cli/cli-plugins/manager"
3334
"github.com/docker/cli/cli/command"
@@ -250,6 +251,16 @@ func RunningAsStandalone() bool {
250251

251252
// RootCommand returns the compose command with its child commands
252253
func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command {
254+
// filter out useless commandConn.CloseWrite warning message that can occur
255+
// when using a remote context that is unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
256+
// https://github.com/docker/cli/blob/e1f24d3c93df6752d3c27c8d61d18260f141310c/cli/connhelper/commandconn/commandconn.go#L203-L215
257+
logrus.AddHook(logutil.NewFilter([]logrus.Level{
258+
logrus.WarnLevel,
259+
},
260+
"commandConn.CloseWrite:",
261+
"commandConn.CloseRead:",
262+
))
263+
253264
opts := projectOptions{}
254265
var (
255266
ansi string

0 commit comments

Comments
 (0)