When using gcloudtoken with ADC, the context might be prematurely canceled.
The expected behavior is that gcloudtoken will use pin if configured and ADC otherwise.
The actual behavior is that it only works if pin is configured, but might now work otherwise. I've encountered this on MacOS + v8.0.0.
// Do not set a timeout on the context passed to NewClient: dialing happens
// asynchronously, and the context is used to refresh credentials in the
// background.
So the code should pass a context without deadline when initializing and only add the deadline in actual calls.
When using gcloudtoken with ADC, the context might be prematurely canceled.
The expected behavior is that gcloudtoken will use
pin
if configured and ADC otherwise. The actual behavior is that it only works ifpin
is configured, but might now work otherwise. I've encountered this on MacOS +v8.0.0
.I'll open a PR to fix this issue.
How to reproduce?
Possible solution
Google Cloud SDK docs state:
So the code should pass a context without deadline when initializing and only add the deadline in actual calls.