-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort conditions #1663
Sort conditions #1663
Conversation
0cc78e3
to
0e09994
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is so that the order of Conditions is stable and predictable.
This changes the type of LastTransitionTime fields to use a new VolatileTime type that is ignored by `equality.Semantic.DeepEqual`. This enables us to elide status updates that only update LastTransitionTime.
0e09994
to
7cafc03
Compare
/test pull-knative-serving-integration-tests |
@@ -95,7 +115,7 @@ type ConfigurationCondition struct { | |||
Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` | |||
|
|||
// +optional | |||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"` | |||
LastTransitionTime VolatileTime `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comment explaining why we choose VolatileTime
vs metav1.Time
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
7cafc03
to
426a9b4
Compare
The following is the coverage report on pkg/.
|
/lgtm |
* Add sorting of the Service conditions. This is so that the order of Conditions is stable and predictable. * Add sorting of the Route conditions. * Add sorting of the Configuration conditions. * Add sorting of the Revision conditions. * Create a new VolatileTime type to wrap metav1.Time. This changes the type of LastTransitionTime fields to use a new VolatileTime type that is ignored by `equality.Semantic.DeepEqual`. This enables us to elide status updates that only update LastTransitionTime. * Make RevisionStatus use RevisionConditionSlice. * Update codegen.
* Add sorting of the Service conditions. This is so that the order of Conditions is stable and predictable. * Add sorting of the Route conditions. * Add sorting of the Configuration conditions. * Add sorting of the Revision conditions. * Create a new VolatileTime type to wrap metav1.Time. This changes the type of LastTransitionTime fields to use a new VolatileTime type that is ignored by `equality.Semantic.DeepEqual`. This enables us to elide status updates that only update LastTransitionTime. * Make RevisionStatus use RevisionConditionSlice. * Update codegen.
Add sorting to our
Conditions
, and makeequality.Semantic
ignore theirLastTransitionTime
fields.This change enables us to elide status updates when a
Reconcile()
would only change the timestamp (and trigger another reconcile, potentially triggering an endless cycle).