From ec9d4649976e1a37a474db39bb5943e2f57f9b65 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 31 Oct 2024 13:41:02 -0500 Subject: [PATCH] compiles after protobuf changes Signed-off-by: Jeff Carr --- event.go | 4 +++- structs.go | 2 +- watchdog.go | 26 -------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/event.go b/event.go index f8569f1..a89dc0c 100644 --- a/event.go +++ b/event.go @@ -76,7 +76,9 @@ func (h *HyperT) start(d *pb.Droplet) (bool, string) { } func findDroplet(name string) *pb.Droplet { - for _, d := range me.cluster.Droplets { + loop := me.cluster.DropletsAll() // get the list of droplets + for loop.Scan() { + d := loop.Droplet() if d.Hostname == name { return d } diff --git a/structs.go b/structs.go index edd304b..454797a 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.NewCluster // basic cluster settings hmap map[*pb.Hypervisor]*HyperT // map to the local struct names []string hypers []*HyperT diff --git a/watchdog.go b/watchdog.go index 0849f65..042e298 100644 --- a/watchdog.go +++ b/watchdog.go @@ -2,9 +2,6 @@ package main import ( "time" - - pb "go.wit.com/lib/protobuf/virtbuf" - "go.wit.com/log" ) // timeFunction takes a function as an argument and returns the execution time. @@ -13,26 +10,3 @@ func TimeFunction(f func()) time.Duration { f() // Execute the function return time.Since(startTime) // Calculate the elapsed time } - -func (h *HyperT) sendDirs() { - url := "http://" + h.pb.Hostname + ":2520/cluster" - var msg string - var data []byte - - var c *pb.Cluster - c = new(pb.Cluster) - for _, dir := range me.cluster.Dirs { - c.Dirs = append(c.Dirs, dir) - } - msg = c.FormatJSON() - data = []byte(msg) // Convert the string to []byte - req, err := httpPost(url, data) - if err != nil { - log.Info("error:", err) - return - } - // log.Info("http post url:", url) - // log.Info("http post data:", msg) - - log.Info("EVENT start droplet response: " + string(req)) -}