Comment 2 for bug 2003727

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

Found another issue with the netplan.io currently in Lunar:

# apt policy netplan.io
netplan.io:
  Installed: 0.105-0ubuntu4
  Candidate: 0.105-0ubuntu4

(the same problem happens with 0.106)

After calling "netplan set" with --origin-hint and an existing interface and then calling it again for a non-existing interface, the original file where the first interface was defined is removed (and the renderer is not preserved):

root@lunar:/etc/netplan# ls
0-defaults.yaml

root@lunar:/etc/netplan# cat 0-defaults.yaml
network:
  version: 2
  renderer: NetworkManager
  bridges:
    br54:
      dhcp4: true

root@lunar:/etc/netplan# netplan set --origin-hint 90-snapd-config bridges.br54.dhcp4=false
root@lunar:/etc/netplan# ls
0-defaults.yaml 90-snapd-config.yaml

root@lunar:/etc/netplan# cat 0-defaults.yaml
network:
  version: 2
  renderer: NetworkManager
  bridges:
    br54:
      dhcp4: true

root@lunar:/etc/netplan# cat 90-snapd-config.yaml
network:
  version: 2
  bridges:
    br54:
      dhcp4: false

root@lunar:/etc/netplan# netplan set ethernets.eth2.dhcp4=false
root@deleteme-lunar:/etc/netplan# ls
70-netplan-set.yaml 90-snapd-config.yaml

root@deleteme-lunar:/etc/netplan# cat 70-netplan-set.yaml
network:
  version: 2
  ethernets:
    eth2:
      dhcp4: false
root@deleteme-lunar:/etc/netplan# cat 90-snapd-config.yaml
network:
  version: 2
  bridges:
    br54:
      dhcp4: false

The same steps on Focal (0.104-0ubuntu2~20.04.2) seem to work fine, except the renderer from 0-defaults.yaml is not preserved in the origin-hint file.