Closed arossert closed 7 months ago
@arossert Can you call the two APIs concurrently using asyncio.gather
.
As per the documentation, each instance is user-configured to use only one of the APIs. It seems in your case, your Windows EC2 instances are configured to use v2.
@kshivakumar yes I tested it on both Windows and Linux, what I don't know to tell is if V2 can be disabled and api/token
call can fail.
If this is the case we can try to do what you suggested and do both, one to try with V1 (without token) and the other with.
Let me know if you think it will work better
I tested it on both Windows and Linux...
Great! @arossert Yeah, please go ahead with concurrently calling both the APIs.
@kshivakumar I ended up keeping the old _get_metadata
flow and added _get_metadata_v2
that generates a token and calls the _get_metadata
with the needed header.
I removed the try...catch block and just ignored the exceptions with the return_exceptions
flag.
I will run some more tests on this new changes and report back
Let me know if this looks good to you.
@arossert Please fix the "DCO" check.
@arossert Please fix the "DCO" check.
Fixed
Added support for IMDSv2 https://github.com/dgzlopes/cloud-detect/issues/27