diff --git a/internal/orchestrator/updates.go b/internal/orchestrator/updates.go index d49213d0..637d0175 100644 --- a/internal/orchestrator/updates.go +++ b/internal/orchestrator/updates.go @@ -23,7 +23,6 @@ import ( v1types "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types" rctypes "github.com/metal-toolbox/rivets/condition" - rcontroller "github.com/metal-toolbox/rivets/events/controller" ) var ( @@ -361,7 +360,7 @@ func filterToReconcile(records []*store.ConditionRecord, updateEvts map[string]* // condition active with stale updatedAt return time.Since(createdAt) >= rctypes.StaleThreshold && - time.Since(updatedAt) >= rcontroller.StatusStaleThreshold + time.Since(updatedAt) >= rctypes.StatusStaleThreshold } // updates @@ -660,7 +659,7 @@ func (o *Orchestrator) queueFollowingCondition(ctx context.Context, cond *rctype // This reconciles conditions in the Condition status KV - $condition.$facility func (o *Orchestrator) eventNeedsReconciliation(evt *v1types.ConditionUpdateEvent) bool { // the last update should be later than the condition stale threshold - if time.Since(evt.ConditionUpdate.UpdatedAt) < rcontroller.StatusStaleThreshold { + if time.Since(evt.ConditionUpdate.UpdatedAt) < rctypes.StatusStaleThreshold { return false } @@ -692,7 +691,7 @@ func (o *Orchestrator) eventNeedsReconciliation(evt *v1types.ConditionUpdateEven } // controller most likely dead - if time.Since(lastTime) > rcontroller.LivenessStaleThreshold { + if time.Since(lastTime) > rctypes.LivenessStaleThreshold { le.WithField( "last.checkin", time.Since(lastTime), diff --git a/internal/orchestrator/updates_test.go b/internal/orchestrator/updates_test.go index c0fb9700..48f8ed06 100644 --- a/internal/orchestrator/updates_test.go +++ b/internal/orchestrator/updates_test.go @@ -31,7 +31,6 @@ import ( v1types "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types" rctypes "github.com/metal-toolbox/rivets/condition" eventsm "github.com/metal-toolbox/rivets/events" - rcontroller "github.com/metal-toolbox/rivets/events/controller" ) var ( @@ -588,7 +587,7 @@ func TestFilterToReconcile(t *testing.T) { Target: sid1, // exceed thresholds CreatedAt: createdTS.Add(-rctypes.StaleThreshold - 2*time.Minute), - UpdatedAt: updatedTS.Add(-rcontroller.StatusStaleThreshold - 2*time.Minute), + UpdatedAt: updatedTS.Add(-rctypes.StatusStaleThreshold - 2*time.Minute), }, { ID: cid1, @@ -718,7 +717,7 @@ func TestFilterToReconcile(t *testing.T) { Target: sid1, // thresholds on record exceeded CreatedAt: createdTS.Add(-rctypes.StaleThreshold - 2*time.Minute), - UpdatedAt: updatedTS.Add(-rcontroller.StatusStaleThreshold - 2*time.Minute), + UpdatedAt: updatedTS.Add(-rctypes.StatusStaleThreshold - 2*time.Minute), }, }, },