Use correct detection method for timeout errors

This commit is contained in:
Ryan Kohler
2022-04-27 11:34:25 -07:00
parent ee145fb569
commit d65db13e65

View File

@@ -89,7 +89,7 @@ var runCommand = func(ctx context.Context, command string, env []string) ([]byte
return response, nil
}
if err == context.DeadlineExceeded {
if ctx.Err() != nil && errors.Is(ctx.Err(), context.DeadlineExceeded) {
return nil, timeoutError()
}