ignore bridge name changes by default

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-25 15:01:16 -05:00
parent 7af7c876e4
commit 9451e162a0
3 changed files with 8 additions and 2 deletions

View File

@ -273,11 +273,14 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) ([]*pb.Event, error)
// log.Info("OKAY. FOUND ETH:", eth.Mac, eth.Name, brname)
found = true
if eth.Name != brname {
log.Info("network changed bridge name:", eth.Mac, eth.Name, brname)
if argv.IgnoreBr {
log.Info("ignoring network changed bridge name:", eth.Mac, eth.Name, brname)
} else {
return nil, errors.New("bridge name changed")
}
}
}
}
if !found {
var eth *pb.Network
eth = new(pb.Network)

View File

@ -13,6 +13,7 @@ var argv args
type args struct {
Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"`
IgnoreCpu bool `arg:"--xml-ignore-cpu" default:"true" help:"ignore non-standard libvirt xml cpus"`
IgnoreBr bool `arg:"--xml-ignore-net" default:"true" help:"ignore network bridge name changes"`
Save bool `arg:"--save" default:"false" help:"save protobuf config after import"`
Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"`
Port int `arg:"--port" default:"8080" help:"allow droplet events via http"`

View File

@ -85,7 +85,9 @@ func main() {
if err != nil {
log.Info("updateDroplet() error", filename)
log.Info("updateDroplet() error", d.pb.Hostname, err)
log.Info("libvirt XML will have to be fixed by hand")
ok = false
os.Exit(-1)
}
}
}