summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-22 16:41:27 -0500
committerJeff Carr <[email protected]>2025-03-23 09:32:50 -0500
commitf90c4af25ee18068cffdb1501f7c0f31c538aee0 (patch)
tree2ea93f368527f821ed318a2d0b9319c89d8a79e0
parentfc82e095ef933d152bc8a627ff6f67a8589c1c6f (diff)
show virtigod version
-rw-r--r--machine.go1
-rw-r--r--main.go10
-rw-r--r--structs.go15
3 files changed, 8 insertions, 18 deletions
diff --git a/machine.go b/machine.go
index 9f188e6..3a920f0 100644
--- a/machine.go
+++ b/machine.go
@@ -43,7 +43,6 @@ func handleMachine(r *http.Request, w http.ResponseWriter, hostname string, data
am := new(zoopb.Machine)
am.Hostname = newm.Hostname
am.Memory = newm.Memory
- // me.machines2.Append(am)
me.machines.Append(newm)
log.Info("new machine", am.Hostname, am.Memory)
return
diff --git a/main.go b/main.go
index 4b9ade8..c4467fc 100644
--- a/main.go
+++ b/main.go
@@ -39,19 +39,11 @@ func main() {
me.hostname, _ = os.Hostname()
me.pollDelay = time.Hour
me.machines = zoopb.NewMachines()
- // me.machines2 = zoopb.NewMachines()
if err := me.machines.ConfigLoad(); err != nil {
log.Warn("load config failed", err)
os.Exit(-1)
}
- /*
- if err := me.machines2.ConfigLoad(); err != nil {
- log.Warn("load config failed", err)
- os.Exit(-1)
- }
- */
- // me.targets = make(map[string]string) // keep track of what versions the machines should be running
- me.upgrade = make(map[string]bool) // used to trigger upgrade attempts
+ // me.upgrade = make(map[string]bool) // used to trigger upgrade attempts
go NewWatchdog()
diff --git a/structs.go b/structs.go
index 28f367e..7152c21 100644
--- a/structs.go
+++ b/structs.go
@@ -15,14 +15,13 @@ var me *zookeep
// this app's variables
type zookeep struct {
- hostname string // my fqdn dns zookeeper hostname
- pollDelay time.Duration // how often to report our status
- dog *time.Ticker // the watchdog timer
- dogchan chan bool // can kill the watchdog
- distro string // debian,redhat,gentoo,macos,wincrap
- packages *zoopb.Packages // installed packages and versions
- machines *zoopb.Machines // every machine that has reported itself to the zookeeper
- // machines2 *zoopb.Machines // every machine that has reported itself to the zookeeper
+ hostname string // my fqdn dns zookeeper hostname
+ pollDelay time.Duration // how often to report our status
+ dog *time.Ticker // the watchdog timer
+ dogchan chan bool // can kill the watchdog
+ distro string // debian,redhat,gentoo,macos,wincrap
+ packages *zoopb.Packages // installed packages and versions
+ machines *zoopb.Machines // every machine that has reported itself to the zookeeper
targets map[string]string // what versions the machines should be running
upgrade map[string]bool // use this to trigger builds
myGui *gui.Node // the gui toolkit handle