compiles and runs

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-22 16:46:39 -05:00
parent 91d2a8a19d
commit 3b64d342d2
2 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import (
var cluster *pb.Cluster
func readConfigFile() {
cluster = new(pb.Cluster)
homeDir, _ := os.UserHomeDir()
fullname := filepath.Join(homeDir, ".config/virtigo.json")
pfile, err := os.ReadFile(fullname)
@ -73,6 +74,7 @@ func readDropletFile(filename string) {
}
me.droplets = append(me.droplets, d)
log.Log(EVENT, "config new droplet", d.Hostname, d.ConfigState, d.hyperPreferred)
cluster.AddDroplet(d.Hostname, 16, 256)
} else {
log.Info("not sure what to do here. duplicate droplet", name, "in config file")
}
@ -124,5 +126,6 @@ func addHypervisor(name string) *HyperT {
h.pollHypervisor()
}
me.hypers = append(me.hypers, h)
cluster.AddHypervisor(name, 16, 256)
return h
}

View File

@ -29,8 +29,10 @@ func main() {
log.DaemonMode(true)
}
readConfigFile()
readDropletFile("droplets")
readHypervisorFile("hypervisor")
writeConfigFile()
// initialize the grid as unstable
me.unstable = time.Now()