Skip to content

Commit

Permalink
chore: added comments to explain that LastTransistionTime will not up…
Browse files Browse the repository at this point in the history
…date (#545)
  • Loading branch information
mfaizanse authored Apr 15, 2024
1 parent f34510a commit 9770c0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/operator/v1alpha1/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (es *EventingStatus) UpdateConditionBackendAvailable(status kmetav1.Conditi
Reason: string(reason),
Message: message,
}
// meta.SetStatusCondition will update LastTransitionTime only when `Status` is changed.
meta.SetStatusCondition(&es.Conditions, condition)
}

Expand All @@ -32,6 +33,7 @@ func (es *EventingStatus) UpdateConditionPublisherProxyReady(status kmetav1.Cond
Reason: string(reason),
Message: message,
}
// LastTransitionTime will only be updated when `Status` is changed.
meta.SetStatusCondition(&es.Conditions, condition)
}

Expand All @@ -45,6 +47,7 @@ func (es *EventingStatus) UpdateConditionWebhookReady(status kmetav1.ConditionSt
Reason: string(reason),
Message: message,
}
// meta.SetStatusCondition will update LastTransitionTime only when `Status` is changed.
meta.SetStatusCondition(&es.Conditions, condition)
}

Expand All @@ -58,6 +61,7 @@ func (es *EventingStatus) UpdateConditionSubscriptionManagerReady(status kmetav1
Reason: string(reason),
Message: message,
}
// meta.SetStatusCondition will update LastTransitionTime only when `Status` is changed.
meta.SetStatusCondition(&es.Conditions, condition)
}

Expand All @@ -71,6 +75,7 @@ func (es *EventingStatus) UpdateConditionDeletion(status kmetav1.ConditionStatus
Reason: string(reason),
Message: message,
}
// meta.SetStatusCondition will update LastTransitionTime only when `Status` is changed.
meta.SetStatusCondition(&es.Conditions, condition)
}

Expand Down

0 comments on commit 9770c0c

Please sign in to comment.