From f5a1bb875d17051aa9fc0872a28582807ddef3a2 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 12 Aug 2022 23:49:02 +0200 Subject: [PATCH] root: filter out commandConn.Close* warning message Signed-off-by: CrazyMax --- cmd/compose/compose.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go index cfa5154a1..10d110884 100644 --- a/cmd/compose/compose.go +++ b/cmd/compose/compose.go @@ -28,6 +28,7 @@ import ( "github.com/compose-spec/compose-go/cli" "github.com/compose-spec/compose-go/types" composegoutils "github.com/compose-spec/compose-go/utils" + "github.com/docker/buildx/util/logutil" dockercli "github.com/docker/cli/cli" "github.com/docker/cli/cli-plugins/manager" "github.com/docker/cli/cli/command" @@ -250,6 +251,16 @@ func RunningAsStandalone() bool { // RootCommand returns the compose command with its child commands func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command { + // filter out useless commandConn.CloseWrite warning message that can occur + // when using a remote context that is unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed" + // https://github.com/docker/cli/blob/e1f24d3c93df6752d3c27c8d61d18260f141310c/cli/connhelper/commandconn/commandconn.go#L203-L215 + logrus.AddHook(logutil.NewFilter([]logrus.Level{ + logrus.WarnLevel, + }, + "commandConn.CloseWrite:", + "commandConn.CloseRead:", + )) + opts := projectOptions{} var ( ansi string