Skip to content

Commit

Permalink
Use naIfError for getting process ENV (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Feb 26, 2024
1 parent 2a1e2a9 commit fff57aa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ee/debug/checkups/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fff57aa

Please sign in to comment.