envoy: improve comments

This commit is contained in:
Daniel Nephin 2021-06-01 11:35:32 -04:00
parent c9bc5f92b7
commit 2054402a53
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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