Skip to content
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

Conversation

tkashem
Copy link
Collaborator

@tkashem tkashem commented May 1, 2019

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

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 1, 2019
@tkashem
Copy link
Collaborator Author

tkashem commented May 1, 2019

/test unit

Copy link
Member

@ecordell ecordell left a 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) {
Copy link
Member

@ecordell ecordell May 1, 2019

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
  }
}

Copy link
Collaborator Author

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
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2019
@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 1, 2019
@tkashem
Copy link
Collaborator Author

tkashem commented May 1, 2019

/retest

2 similar comments
@ecordell
Copy link
Member

ecordell commented May 2, 2019

/retest

@ecordell
Copy link
Member

ecordell commented May 2, 2019

/retest

@tkashem
Copy link
Collaborator Author

tkashem commented May 2, 2019

/test e2e-aws-olm

1 similar comment
@tkashem
Copy link
Collaborator Author

tkashem commented May 2, 2019

/test e2e-aws-olm

@tkashem
Copy link
Collaborator Author

tkashem commented May 2, 2019

/retest

@tkashem
Copy link
Collaborator Author

tkashem commented May 2, 2019

/test e2e-aws-olm

1 similar comment
@tkashem
Copy link
Collaborator Author

tkashem commented May 2, 2019

/test e2e-aws-olm

@openshift-merge-robot openshift-merge-robot merged commit 0772e80 into operator-framework:master May 2, 2019
@tkashem tkashem deleted the csv-conditions-length branch May 3, 2019 18:30
@tkashem tkashem restored the csv-conditions-length branch May 8, 2019 19:16
@ecordell ecordell changed the title Set limit on length of Status.Conditions of a csv Bug 1746054: Set limit on length of Status.Conditions of a csv Aug 27, 2019
@openshift-ci-robot
Copy link
Collaborator

@tkashem: All pull requests linked via external trackers have merged. Bugzilla bug 1746054 has been moved to the MODIFIED state.

In response to this:

Bug 1746054: Set limit on length of Status.Conditions of a csv

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants