Cleanup generic status handling
- remove unused type
- Ensure last transition time matches last probe time
@@ -31,8 +31,6 @@ import (
type PropagationStatus string
-type AggregateStatus string
-
type AggregateReason string
type ConditionType string
@@ -178,18 +176,17 @@ func (s *GenericPropagationStatus) setPropagationCondition(reason AggregateReaso
s.Conditions = append(s.Conditions, propCondition)
}
+ propCondition.Status = newStatus
+ propCondition.Reason = reason
+ propCondition.LastProbeTime = time.Now().UTC().Format(time.RFC3339)
+
// Determine whether the latest status represents a change from
// the old that requires updating the transition time.
transition := newCondition || propCondition.Status != newStatus
if transition {
- propCondition.Status = newStatus
- propCondition.LastTransitionTime = time.Now().UTC().Format(time.RFC3339)
-
+ propCondition.LastTransitionTime = propCondition.LastProbeTime
}
- propCondition.Reason = reason
- propCondition.LastProbeTime = time.Now().UTC().Format(time.RFC3339)
-
}
// setClusterStatus sets the cluster status slice from a propagation
