From f45dacfcaf5d674b8ec36a245591088e0e8f0f81 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Nov 2024 05:22:41 -0600 Subject: [PATCH] create works from a filename Signed-off-by: Jeff Carr --- create.go | 9 ++++++--- main.go | 2 +- structs.go | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/create.go b/create.go index 0846b1d..878a140 100644 --- a/create.go +++ b/create.go @@ -25,14 +25,17 @@ func createFilename(dir string, filename string) error { hostname := strings.TrimSuffix(filename, filetype) log.Info("hostname ==", hostname) - var newDroplet *pb.Droplet - newDroplet = new(pb.Droplet) - newDroplet.Hostname = hostname + newDroplet := pb.NewDefaultDroplet(hostname) newDisk := new(pb.Disk) newDisk.Filename = filename newDisk.Filepath = dir newDroplet.Disks = append(newDroplet.Disks, newDisk) + var eth *pb.Network + eth = new(pb.Network) + eth.Name = "worldbr" + newDroplet.Networks = append(newDroplet.Networks, eth) + url := urlbase + "/create" // body, err := postDropletJSON(url, newDroplet) diff --git a/main.go b/main.go index 456e67b..8d4cd68 100644 --- a/main.go +++ b/main.go @@ -77,7 +77,7 @@ func main() { } log.Info("\n\nshould import here", argv.Start, "\n") log.Info("import", argv.Import.Host, argv.Import.DomainName) - url := "/import?domainName=" + argv.Import.DomainName + url := "/import?domainName=" + argv.Import.DomainName if argv.Import.Force { url += "&force=true" } diff --git a/structs.go b/structs.go index ebd0c73..edd304b 100644 --- a/structs.go +++ b/structs.go @@ -20,7 +20,7 @@ func (b *virtigoT) Enable() { // this app's variables type virtigoT struct { - cluster *pb.Cluster // basic cluster settings + cluster *pb.Cluster // basic cluster settings hmap map[*pb.Hypervisor]*HyperT // map to the local struct names []string hypers []*HyperT