From 5c1ab3c62d43714df503bfbcd1f30a0d75334b2a Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Sat, 27 Mar 2021 15:57:16 +0000 Subject: [PATCH] personal/q3k/shipstuck: fix detection Change-Id: I888eaa95c0012830219bd06fd4d16e66204e2e1d --- personal/q3k/mirko.jsonnet | 2 +- personal/q3k/shipstuck/main.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/personal/q3k/mirko.jsonnet b/personal/q3k/mirko.jsonnet index db7750e8..07981caa 100644 --- a/personal/q3k/mirko.jsonnet +++ b/personal/q3k/mirko.jsonnet @@ -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") { diff --git a/personal/q3k/shipstuck/main.go b/personal/q3k/shipstuck/main.go index 0224c3dc..f35b9f48 100644 --- a/personal/q3k/shipstuck/main.go +++ b/personal/q3k/shipstuck/main.go @@ -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)