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

Fallback to IMDSv1 when IMDSv2 token request reaches hop limit #655

Merged
merged 6 commits into from
Aug 1, 2023

Conversation

omus
Copy link
Member

@omus omus commented Aug 1, 2023

Fixes #654, mitigates #651, and modifies PR #650 to no longer report the ETIMEOUT as a connection error. It turns out that particular error indicates that the IMDSv2 PUT request for a token has reached the max hop limit and the server is rejecting the packet. This PR updates the IMDS code to classify this error as a TTL expiration and fall back to using IMDSv1 rather than treating the IMDS service as being unavailable.

The TTL timeout is rather slow so users should consider increasing their hop limit in order to allow IMDSv2 to be used in these scenarios. I'll add a warning to inform users of this

test/IMDS.jl Outdated Show resolved Hide resolved
@omus omus self-assigned this Aug 1, 2023
@omus omus merged commit d10c5a4 into master Aug 1, 2023
5 checks passed
@omus omus deleted the cv/hop-limit branch August 1, 2023 18:38
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.

Using IMDS.get in a Docker container fails to fall back to IMDSv1
1 participant