← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:dracut into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
> index 556a10f..c05d36c 100755
> --- a/cloudinit/net/cmdline.py
> +++ b/cloudinit/net/cmdline.py
> @@ -137,6 +203,24 @@ def config_from_klibc_net_cfg(files=None, mac_addrs=None):
>      return {'config': entries, 'version': 1}
>  
>  
> +def read_initramfs_config():
> +    """
> +    Return v1 network config for initramfs-configured networking (or None)

At the very least the Oracle DS is relying on this being v1, so it can merge secondary NIC config into it.  So this _does_ need to be v1 until we lift up everything to v2 (and even then it will always need to be consistent across InitramfsNetworkConfigSources).

> +
> +    This will consider each _INITRAMFS_CONFIG_SOURCES entry in turn, and return
> +    v1 network configuration for the first one that is applicable.  If none are
> +    applicable, return None.
> +    """
> +    for src_cls in _INITRAMFS_CONFIG_SOURCES:

In KlibcNetworkConfigSource.is_applicable, we check for the klibc-written files before we even look at the kernel cmdline.  So if there aren't any /run/{net,net6}-*.conf files, we won't select KlibcNetworkConfigSource.

(I'll improve the docstring on KlibcNetworkConfigSource.is_applicable, because I _also_ thought this was going to be a problem for a while and clearly it wasn't just me. :)

> +        cfg_source = src_cls()
> +
> +        if not cfg_source.is_applicable():
> +            continue
> +
> +        return cfg_source.render_config()
> +    return None
> +
> +
>  def _decomp_gzip(blob, strict=True):
>      # decompress blob. raise exception if not compressed unless strict=False.
>      with io.BytesIO(blob) as iobuf:


-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/371673
Your team cloud-init commiters is requested to review the proposed merge of ~daniel-thewatkins/cloud-init/+git/cloud-init:dracut into cloud-init:master.


References