Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-31 13:19:06 -05:00
parent 2ab607246e
commit 168061377b
1 changed files with 5 additions and 3 deletions

View File

@ -14,7 +14,7 @@ import (
)
// import a libvirt xml file
func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
func AddDomainDroplet(cluster *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
var alle []*pb.Event
if domcfg == nil {
return nil, alle, errors.New("domcfg == nil")
@ -46,13 +46,15 @@ func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Dropl
return d, alle, nil
}
func findDomain(c *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
func findDomain(c *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
var found *pb.Droplet
if domcfg == nil {
return nil, errors.New("domcfg == nil")
}
for _, d := range c.Droplets {
loop := c.DropletsAll() // get the list of droplets
for loop.Scan() {
d := loop.Droplet()
if d.Hostname == domcfg.Name {
if d.Uuid != domcfg.UUID {
if domcfg.UUID == "" {