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() }