cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

[enhancement]: Performance improvement - is_resolvable with IP based metadata URL

Open ozekidesu opened this issue 2 months ago • 0 comments

Enhancement

When using metadata URLs like http://169.254.169.254 OR http://[fd00:ec2::254] dns resolution is unnecessary.
Moving the following codeblock in cloudinit/util.py to just before line 1310 will allow an affirmative ip detection to bypass the dns resolution step

# ip addresses need no resolution
try:
    with suppress(ValueError):
        if net.is_ip_address(parsed_url.netloc.strip("[]")):
            return True
except (ValueError, AttributeError):
    pass

ozekidesu avatar Nov 04 '25 01:11 ozekidesu