From 2054402a5390d912fb8250be45473c90a5071b42 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 1 Jun 2021 11:35:32 -0400 Subject: [PATCH] envoy: improve comments --- command/connect/envoy/exec_test.go | 3 +++ .../envoy/pipe-bootstrap/connect_envoy_pipe-bootstrap.go | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/command/connect/envoy/exec_test.go b/command/connect/envoy/exec_test.go index 1c08ff7f84..5ee29d147c 100644 --- a/command/connect/envoy/exec_test.go +++ b/command/connect/envoy/exec_test.go @@ -267,6 +267,9 @@ func limitProcessLifetime(dur time.Duration) { // Also sets up a cleanup function to revert the patch when the test exits. func patchExecArgs(t *testing.T) { orig := execArgs + // go run will run the consul source from the root of the repo. The relative + // path is necessary because `go test` always sets the working directory to + // the directory of the package being tested. execArgs = func(args ...string) (string, []string, error) { args = append([]string{"run", "../../.."}, args...) return "go", args, nil diff --git a/command/connect/envoy/pipe-bootstrap/connect_envoy_pipe-bootstrap.go b/command/connect/envoy/pipe-bootstrap/connect_envoy_pipe-bootstrap.go index 25ef6ad3d9..2685a6bb6a 100644 --- a/command/connect/envoy/pipe-bootstrap/connect_envoy_pipe-bootstrap.go +++ b/command/connect/envoy/pipe-bootstrap/connect_envoy_pipe-bootstrap.go @@ -69,11 +69,12 @@ func (c *cmd) Run(args []string) int { return 1 } + // Use Warn to send to stderr, because all logs should go to stderr. + c.UI.Warn("Bootstrap sent, unlinking named pipe") + // Removed named pipe now we sent it. Even if Envoy has not yet read it, we // know it has opened it and has the file descriptor since our write above // will block until there is a reader. - c.UI.Warn("Bootstrap sent, unlinking named pipe") - os.RemoveAll(args[0]) return 0