From d65db13e65081901f39f17e66f17476853e22713 Mon Sep 17 00:00:00 2001 From: Ryan Kohler Date: Wed, 27 Apr 2022 11:34:25 -0700 Subject: [PATCH 1/2] Use correct detection method for timeout errors --- google/internal/externalaccount/executablecredsource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/internal/externalaccount/executablecredsource.go b/google/internal/externalaccount/executablecredsource.go index 6fbb70e..6e79b90 100644 --- a/google/internal/externalaccount/executablecredsource.go +++ b/google/internal/externalaccount/executablecredsource.go @@ -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() } From 897ba4b211fd2961ae5344d75e1f752f08e5785e Mon Sep 17 00:00:00 2001 From: Ryan Kohler Date: Thu, 28 Apr 2022 06:28:56 -0700 Subject: [PATCH 2/2] Changes requested by @codyoss --- google/internal/externalaccount/executablecredsource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/internal/externalaccount/executablecredsource.go b/google/internal/externalaccount/executablecredsource.go index 6e79b90..473118e 100644 --- a/google/internal/externalaccount/executablecredsource.go +++ b/google/internal/externalaccount/executablecredsource.go @@ -89,7 +89,7 @@ var runCommand = func(ctx context.Context, command string, env []string) ([]byte return response, nil } - if ctx.Err() != nil && errors.Is(ctx.Err(), context.DeadlineExceeded) { + if ctx.Err() == context.DeadlineExceeded { return nil, timeoutError() }