1
0
Fork 0

personal/q3k/shipstuck: fix detection

Change-Id: I888eaa95c0012830219bd06fd4d16e66204e2e1d
master
q3k 2021-03-27 15:57:16 +00:00 committed by q3k
parent 3d116b2952
commit 5c1ab3c62d
2 changed files with 3 additions and 6 deletions

View File

@ -4,7 +4,7 @@ local mirko = import "../../kube/mirko.libsonnet";
local top = self,
shipstuck:: {
cfg:: {
image: "registry.k0.hswaw.net/q3k/shipstuck:315532800-a7282b5aa2952e5eb66a1c3ecf7cdafef8335aba",
image: "registry.k0.hswaw.net/q3k/shipstuck:315532800-995ff64373c178fb6de848bd051f56abac8bb66c",
domain: error "domain must be set",
},
component(cfg, env): mirko.Component(env, "shipstuck") {

View File

@ -17,10 +17,7 @@ import (
)
type vessel struct {
// No idea what these fields are, but they seem to be related to
// latitude/longitude. Use these to detect the stuckness of the ship.
GT int64 `json:"gt"`
DW int64 `json:"dw"`
Speed float64 `json:"ss"`
}
// get retrieves the current status of the ship - returns true if stack, false
@ -48,7 +45,7 @@ func get(ctx context.Context) (bool, error) {
return false, fmt.Errorf("Decode: %w", err)
}
if v.GT == 219079 && v.DW == 199489 {
if v.Speed == 0.0 {
return true, nil
} else {
glog.Infof("Freed! %+v", v)