-
Notifications
You must be signed in to change notification settings - Fork 544
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
Bug 1746054: Set limit on length of Status.Conditions of a csv #836
Bug 1746054: Set limit on length of Status.Conditions of a csv #836
Conversation
/test unit |
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.
The changes look great! I left a minor comment about the tests just to keep them consistent with our others in terms of style, but that's it
@@ -282,3 +284,111 @@ func TestSupports(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestSetPhaseWithConditionsLengthAtLimit(t *testing.T) { |
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.
These tests look good, but we try to keep a consistent style for tests. Generally we do a "table-driven" test style, where each test case defines expected inputs/outputs.
So for these tests, that would look something like
func TestSetPhaseLengthLimits() {
tests := []struct{
name string
currentConditions []conditions
args args
expected expected
} {
// an instance for each test case
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// set csv conditions to tt.currentConditions
// call csv.SetPhase(args)
// check csv conditions == expected
}
}
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.
@ecordell converted to table driven, it looks concise and more readable now. Can you take a look?
Set a maximum length of Status.Conditions of ClusterServiceVersion object(s). The oldest condition(s) should be removed from the list as it grows over time to keep it at limit. The default limit is set to 20. Jira: https://jira.coreos.com/browse/OLM-963
c4f83e1
to
af2a3b3
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, tkashem 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 |
/retest |
2 similar comments
/retest |
/retest |
/test e2e-aws-olm |
1 similar comment
/test e2e-aws-olm |
/retest |
/test e2e-aws-olm |
1 similar comment
/test e2e-aws-olm |
@tkashem: All pull requests linked via external trackers have merged. Bugzilla bug 1746054 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Set a maximum length of Status.Conditions of ClusterServiceVersion
object(s). The oldest condition(s) should be removed from the list
as it grows over time to keep it at limit.
The default limit is set to 20.
Jira: https://jira.coreos.com/browse/OLM-963