Skip to content

Commit

Permalink
fix: IsConditionChanged will ignore lastTransitionTime to make it mor…
Browse files Browse the repository at this point in the history
…e usable
  • Loading branch information
danielfbm committed Feb 8, 2023
1 parent 858e01a commit 1d1eac5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func IsConditionChanged(current, old apis.ConditionAccessor, conditionType apis.
return false
}
return (currentCondition.Status != oldCondition.Status) ||
!currentCondition.LastTransitionTime.Inner.Equal(&oldCondition.LastTransitionTime.Inner) ||
currentCondition.Reason != oldCondition.Reason
currentCondition.Reason != oldCondition.Reason ||
currentCondition.Message != oldCondition.Message
}

// GetCondition will return the first condition pointer filter by type in conditions
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestIsConditionChanged(t *testing.T) {
apis.Condition{Type: SomeCondition, Status: corev1.ConditionUnknown, LastTransitionTime: apis.VolatileTime{Inner: oneSecondAgo}},
}}},
conditionType: SomeCondition,
expected: true,
expected: false,
},
"Condition status is the same, last transition same, reason changed": {
current: &StatusTest{duckv1.Status{Conditions: duckv1.Conditions{
Expand Down

0 comments on commit 1d1eac5

Please sign in to comment.