Skip to content

Commit

Permalink
Add Support for IPv6 metadata to OpenStack (#1805)
Browse files Browse the repository at this point in the history
- Add openstack IPv6 metadata url fe80::a9fe:a9fe
- Enable requesting multiple metadata sources in parallel

This PR is very similar to #1160, reusing the provided `url_heper` logic.

LP: #1906849
  • Loading branch information
SRv6d authored Nov 17, 2022
1 parent 33eb9b1 commit 25da3c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cloudinit/sources/DataSourceOpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
LOG = logging.getLogger(__name__)

# Various defaults/constants...
DEF_MD_URL = "http://169.254.169.254"
DEF_MD_URLS = ["http://[fe80::a9fe:a9fe]", "http://169.254.169.254"]
DEFAULT_IID = "iid-dsopenstack"
DEFAULT_METADATA = {
"instance-id": DEFAULT_IID,
Expand Down Expand Up @@ -74,7 +74,7 @@ def __str__(self):
return mstr

def wait_for_metadata_service(self):
urls = self.ds_cfg.get("metadata_urls", [DEF_MD_URL])
urls = self.ds_cfg.get("metadata_urls", DEF_MD_URLS)
filtered = [x for x in urls if util.is_resolvable_url(x)]
if set(filtered) != set(urls):
LOG.debug(
Expand All @@ -85,7 +85,7 @@ def wait_for_metadata_service(self):
urls = filtered
else:
LOG.warning("Empty metadata url list! using default list")
urls = [DEF_MD_URL]
urls = DEF_MD_URLS

md_urls = []
url2base = {}
Expand All @@ -100,6 +100,7 @@ def wait_for_metadata_service(self):
urls=md_urls,
max_wait=url_params.max_wait_seconds,
timeout=url_params.timeout_seconds,
connect_synchronously=False,
)
if avail_url:
LOG.debug("Using metadata source: '%s'", url2base[avail_url])
Expand Down
1 change: 1 addition & 0 deletions tools/.github-cla-signers
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ rmhsawyer
rongz609
s-makin
SadeghHayeri
SRv6d
sarahwzadara
scorpion44
shaardie
Expand Down

0 comments on commit 25da3c7

Please sign in to comment.