From fff57aaf2cf7a9024582cd7a30a3ddb4848959d9 Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Mon, 26 Feb 2024 09:21:35 -0500 Subject: [PATCH] Use naIfError for getting process ENV (#1622) --- ee/debug/checkups/processes.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ee/debug/checkups/processes.go b/ee/debug/checkups/processes.go index ef1ea61be..e90155be6 100644 --- a/ee/debug/checkups/processes.go +++ b/ee/debug/checkups/processes.go @@ -57,11 +57,10 @@ func (c *Processes) Run(ctx context.Context, fullWriter io.Writer) error { if strings.Contains(strings.ToLower(exe), "kolide") { c.kolideCount += 1 - // Grab ENV vars if available -- we ignore the error because we expect - // this function to return `ErrNotImplementedError` on darwin - if envVars, err := p.EnvironWithContext(ctx); err == nil { - pMap["env"] = strings.Join(envVars, " ") - } + // Grab ENV vars -- available on windows/linux but not darwin; + // included primarily for troubleshooting browser opening issues + // on linux + pMap["env"] = naIfError(p.EnvironWithContext(ctx)) c.data[fmt.Sprintf("%d", p.Pid)] = pMap