Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(common): create default gRPC credentials only if needed #10280

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Nov 19, 2022

For backwards compatibility with the pre-Unified Credentials world we were calling grpc::GoogleDefaultCredentials() if g::c::GrpcCredentialsOption was not set. In many cases the option is not set, but g::c::UnifiedCredentialsOption is. If that is the case, the unified options are preferred. Calling
grpc::GoogleDefaultCredentials() produces spurious errors, and these credentials won't be used.


This change is Reviewable

For backwards compatibility with the pre-Unified Credentials world we
were calling `grpc::GoogleDefaultCredentials()` if
`g::c::GrpcCredentialsOption` was not set. In many cases the option is
not set, but `g::c::UnifiedCredentialsOption` is. If that is the case,
the unified options are preferred. Calling
`grpc::GoogleDefaultCredentials()` produces spurious errors, and these
credentials won't be used.
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: d0ebf76208e3230b55ade1e116d19d6513fceb7d

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Nov 19, 2022

Codecov Report

Base: 93.83% // Head: 93.83% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (d0ebf76) compared to base (2e80c50).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10280   +/-   ##
=======================================
  Coverage   93.83%   93.83%           
=======================================
  Files        1573     1573           
  Lines      144070   144071    +1     
=======================================
+ Hits       135182   135188    +6     
+ Misses       8888     8883    -5     
Impacted Files Coverage Δ
google/cloud/internal/populate_grpc_options.cc 100.00% <100.00%> (ø)
google/cloud/bigtable/async_read_stream_test.cc 97.32% <0.00%> (-0.67%) ⬇️
google/cloud/pubsub/subscriber_connection_test.cc 97.81% <0.00%> (-0.55%) ⬇️
google/cloud/pubsub/samples/samples.cc 90.70% <0.00%> (-0.08%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 98.15% <0.00%> (+0.33%) ⬆️
google/cloud/storage/parallel_upload.cc 98.62% <0.00%> (+0.34%) ⬆️
...le/cloud/internal/default_completion_queue_impl.cc 97.15% <0.00%> (+0.56%) ⬆️
...integration_tests/schema_admin_integration_test.cc 100.00% <0.00%> (+1.11%) ⬆️
...bigtable/examples/bigtable_hello_instance_admin.cc 83.00% <0.00%> (+2.00%) ⬆️
...e/cloud/pubsublite/internal/alarm_registry_impl.cc 100.00% <0.00%> (+2.94%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coryan coryan marked this pull request as ready for review November 19, 2022 17:30
@coryan coryan requested a review from a team as a code owner November 19, 2022 17:30
Copy link
Contributor

@devbww devbww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@coryan coryan merged commit 6b0a1d7 into googleapis:main Nov 19, 2022
@coryan coryan deleted the repro-grpc-error-with-non-default-credentials branch November 19, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants