try building a package

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-26 21:49:08 -05:00
parent 69a8b35a14
commit 255ffc9488
2 changed files with 9 additions and 20 deletions

View File

@ -8,9 +8,9 @@ import (
"fmt"
"github.com/google/uuid"
pb "go.wit.com/lib/protobuf/virtbuf"
"go.wit.com/log"
"libvirt.org/go/libvirtxml"
pb "go.wit.com/lib/protobuf/virtbuf"
)
// import a libvirt xml file
@ -298,9 +298,9 @@ func updateNetwork(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain
}
if eth.Name != brname {
// if argv.IgnoreBr {
log.Info("network was:", eth.Mac, eth.Name)
log.Info("network now:", eth.Mac, brname)
log.Info("ignoring network change (--xml-ignore-net)")
log.Info("network was:", eth.Mac, eth.Name)
log.Info("network now:", eth.Mac, brname)
log.Info("ignoring network change (--xml-ignore-net)")
// } else {
// return nil, errors.New("bridge name changed")
// }

View File

@ -3,6 +3,7 @@
package virtigoxml
import (
"errors"
"fmt"
"os"
"path/filepath"
@ -15,21 +16,9 @@ import (
// generate the XML for 'virsh create'
func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error {
/*
if d == nil {
log.Info("droplet is nil")
os.Exit(0)
}
log.Info("start droplet here:", d.Hostname)
domcfg := &libvirtxml.Domain{}
addDefaultXml(domcfg, "standard.x86")
// addDefaultXml(domcfg, "memory")
// addDefaultXml(domcfg, "network")
addDefaultXml(domcfg, "spice")
addDefaultXml(domcfg, "qcow")
*/
if d == nil {
return errors.New("*droplet == nil")
}
domcfg.Type = "kvm"
domcfg.Name = d.Hostname
domcfg.UUID = d.Uuid
@ -71,9 +60,9 @@ func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain,
// setRandomMacs(domcfg)
if len(dirs) == 0 {
dirs = append(dirs, "/var/lib/libvirt/images")
dirs = append(dirs, "/home/nfs2")
dirs = append(dirs, "/home/nfs3")
dirs = append(dirs, "/var/lib/libvirt/images")
}
log.Info("Should look in dirs:", dirs)
for _, disk := range d.Disks {