agent/cert: properly return the cached client on AuthClient #11576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a bug on the agent cert auto-auth method where the client returned was not the cached client if
AuthClient
was called on subsequent auth requests.Possibly fixes #10835. This fixes an issue that had the same error message as the one reported there, but the error only appeared if
auth.cert
was expecting a cached client to be returned (e.g. due to a re-auth or retry after backoff)Test fixtures were copied over from the
api
package in order to keep the tests lean and avoid instantiating a test cluster to dynamically generate them like we do on the end-to-end test (and thus carrying over a bunch of imports to the cert package).