Repository navigation
Conversation
Signed-off-by: Anshul Jagota <anshul.jagota@yahoo.com>
|
The existing code already reloads credentials when a cache entry expires: it falls through to I ran the added tests against the original code. Only the direct I'm closing this because it doesn't demonstrate a fix for #3977. That issue still needs investigation. A reproduction showing where the existing refresh path fails would help us identify the right change. |
What this PR does
Fixes #3977.
During long-running builds with
--pushor--cache-toagainst registries with short-lived tokens (such as Google Artifact Registry via thegcloudcredential helper), token fetching failed with:failed to authorize: failed to fetch oauth token: unauthorized: authentication failedThis happens because the in-memory credential cache retained stale credentials past their expiration window.
This change:
loadHostdefaults to the 4m50s expiration threshold even if called with a nil check function.authConfigCacheso credential helpers are re-executed to obtain fresh tokens on renewal.