summaryrefslogtreecommitdiff
path: root/poll.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-28 05:07:56 -0500
committerJeff Carr <[email protected]>2024-10-28 05:07:56 -0500
commit3f7171fff2898deef6a8f1d5180ea11217123324 (patch)
treef9aa27ad90632cbb380b87e8b297d7fef9e6050d /poll.go
parent8fc2fbd9c9a6f05852cd597b246f0b4e634af7d7 (diff)
make an event for droplet moving hypervisorsv0.2.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'poll.go')
-rw-r--r--poll.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/poll.go b/poll.go
index 73cbbea..1fa5d58 100644
--- a/poll.go
+++ b/poll.go
@@ -77,9 +77,17 @@ func (h *HyperT) pollHypervisor() {
continue
}
+ // if this is blank, the droplet has probably never booted yet
+ if d.CurrentHypervisor == "" {
+ d.CurrentHypervisor = h.pb.Hostname
+ continue
+ }
+
// this means the droplet has moved
if d.CurrentHypervisor != h.pb.Hostname {
log.Log(EVENT, "droplet", d.Hostname, "moved to", h.pb.Hostname)
+ // record the droplet migrated (or booted somewhere else? recording this is a work in progress)
+ me.cluster.DropletMoved(d, h.pb)
continue
}
d.CurrentHypervisor = h.pb.Hostname