Page MenuHomeVyOS Platform

DNS cannot be configured via Network-Config v1 received from ConfigDrive / Cloud-Init
Closed, ResolvedPublicBUG

Description

The Cloud-Init manual says that the address field in the Nameserver configuration item type should be a list of addresses:
https://github.com/canonical/cloud-init/blob/7d57fcff6d32fd706dd745315c0f8f72d94385eb/doc/rtd/reference/network-config-format-v1.rst#nameserver

However, inside sources for ConfigDrive DNS entries are converted into simple strings: https://github.com/canonical/cloud-init/blob/7d57fcff6d32fd706dd745315c0f8f72d94385eb/cloudinit/sources/helpers/openstack.py#L753-L756

An example.
Source in the ConfigDrive:

"services" : [
   {
      "address" : "192.0.2.1",
      "type" : "dns"
   },
   {
      "address" : "192.0.2.2",
      "type" : "dns"
   }
]

Rendered Network-Config v1:

{'address': '10.191.255.6', 'type': 'nameserver'},
{'address': '10.255.255.6', 'type': 'nameserver'}],

Because of this, our configuration handler tries to configure each character as a DNS server.

Since this is not the first time when specification and implementation in Cloud-Init are different, I think that we should just add a workaround to this case.

Details

Difficulty level
Easy (less than an hour)
Version
1.4-rolling-202301250317, 1.3.2
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)