diff options
| author | Jeff Carr <[email protected]> | 2024-10-25 05:04:52 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-25 05:04:52 -0500 |
| commit | 178974e42fe6ca3517f7485413184cf17b188977 (patch) | |
| tree | 979b6459d8a1a230850d30fcb4329cca46f1a44e /addDroplet.go | |
| parent | fb722a3dc95f77b868ce250d52d73ec8fba8c677 (diff) | |
cleaner xml processing
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'addDroplet.go')
| -rw-r--r-- | addDroplet.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addDroplet.go b/addDroplet.go index 3e94ec5..9c2c266 100644 --- a/addDroplet.go +++ b/addDroplet.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" + "github.com/google/uuid" pb "go.wit.com/lib/protobuf/virtbuf" "go.wit.com/log" "libvirt.org/go/libvirtxml" @@ -28,6 +29,12 @@ func addDomainDroplet(domcfg *libvirtxml.Domain) (*DropletT, error) { d.pb.StartState = pb.DropletState_OFF d.CurrentState = pb.DropletState_UNKNOWN + // if the domcfg doesn't have a uuid, make a new one here + if d.pb.Uuid == "" { + u := uuid.New() + d.pb.Uuid = u.String() + } + me.droplets = append(me.droplets, d) me.changed = true |
