Comment 1 for bug 2007304

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Hi, thanks for your bug report.

I can confirm the issue still exists on netplan.io 0.106.

The problem happens when the bridge "parameters" section is omitted. When this field is not defined, the handler responsible for initializing the related data structures in the netplan parser is never called and the backend configuration is never generated.

To fix this we need to initialize the bridge parameters [0] regardless the existence of the field "parameters" in the YAML file.

Here is a simpler reproducer:

$ cat etc/netplan/90-configs.yaml
network:
  bridges:
    br-mgmt: {}

$ netplan generate --root-dir /tmp/fakeroot/

$ cat run/systemd/network/10-netplan-br-mgmt.netdev
[NetDev]
Name=br-mgmt
Kind=bridge

Defining an empty "parameters" section is enough to make the parser emit the configuration correctly.

$ cat etc/netplan/90-configs.yaml
network:
  bridges:
    br-mgmt:
      parameters: {}

$ netplan generate --root-dir /tmp/fakeroot/

$ cat run/systemd/network/10-netplan-br-mgmt.netdev
[NetDev]
Name=br-mgmt
Kind=bridge

[Bridge]
STP=true

[0] - https://github.com/canonical/netplan/blob/main/src/parse.c#L1891