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

Log clean up #44

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Log clean up #44

merged 1 commit into from
Jan 22, 2025

Conversation

xdu31
Copy link
Member

@xdu31 xdu31 commented Jan 22, 2025

Issue #, if available:

Description of changes:

Log clean up

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@xdu31 xdu31 requested a review from a team as a code owner January 22, 2025 05:18
@@ -201,13 +201,13 @@ func (r *cachedCredentialRetriever) GetIamCredentials(ctx context.Context,
log.WithField("cache-hit", 0).Tracef("Could not find entry in cache, requesting creds from delegate")

iamCredentials, metadata, err := r.callDelegateAndCache(ctx, request)
defer func() {
defer func(err error) {
Copy link

Choose a reason for hiding this comment

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

i don't see any logic after this, is there a need for defer here?

r.internalActiveRequestCache.ReplaceWithExpire(request.ServiceAccountToken, err, defaultActiveRequestInterval)
}
}()
if err == nil {
Copy link

Choose a reason for hiding this comment

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

Suggested change
if err == nil {
if err == nil {
r.internalActiveRequestCache.Delete(request.ServiceAccountToken)
return iamCredentials.credentials, metadata, nil
}
r.internalActiveRequestCache.ReplaceWithExpire(request.ServiceAccountToken, err, defaultActiveRequestInterval)
return nil, nil, err

@xdu31 xdu31 merged commit 55d6609 into aws:main Jan 22, 2025
1 check passed
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.

2 participants