Skip to content

Conversation

@aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Nov 4, 2021

Issue #

N/A

Description of changes

Finishes the IMDS client implementation by implementing the retry behavior specific to IMDS.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aajtodd aajtodd requested review from ianbotsf and kggilmer November 4, 2021 16:32
status.category() == HttpStatusCode.Category.SERVER_ERROR -> RetryDirective.RetryError(RetryErrorType.ServerSide)
// 401 indicates the token has expired, this is retryable
status == HttpStatusCode.Unauthorized -> RetryDirective.RetryError(RetryErrorType.ServerSide)
else -> RetryDirective.TerminateAndFail
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion

if it ever happens that we wish to debug why imds didn't retry it would be nice to emit the a log message with the terminating status code.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aajtodd aajtodd merged commit e1c9e42 into main Nov 4, 2021
@aajtodd aajtodd deleted the feat-imds-retry branch November 4, 2021 18:53
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