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

adds paginating lister for evaluating CRs' upgrade fitness versus new CRDs. #3387

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

grokspawn
Copy link
Contributor

Description of the change:
adds a paging lister for listing CRs deployed in the cluster, used for fitness testing new CRD versions during upgrade.

Motivation for the change:
scaling issues in clusters where listing CRs for an operator would exceed apiserver timeouts

Architectural changes:
since previously we attempted to load the list of all related CRs into memory, this should also significantly help with memory usage by OLM during upgrade evaluation.

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Signed-off-by: Jordan Keister <[email protected]>
for _, cr := range crList.Items {
err = validation.ValidateCustomResource(field.NewPath(""), cr.UnstructuredContent(), validator).ToAggregate()
pager := pager.New(pager.SimplePageFunc(func(opts metav1.ListOptions) (runtime.Object, error) {
return dynamicClient.Resource(gvr).List(context.TODO(), metav1.ListOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return dynamicClient.Resource(gvr).List(context.TODO(), metav1.ListOptions{})
return dynamicClient.Resource(gvr).List(context.TODO(), opts)

Copy link
Contributor

@tmshort tmshort Sep 4, 2024

Choose a reason for hiding this comment

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

The ListOptions argument opts isn't being used...
Presumably that's how it's paging/restricting output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in ca452be

Signed-off-by: Jordan Keister <[email protected]>
Copy link
Contributor

@tmshort tmshort 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2024
@grokspawn grokspawn added this pull request to the merge queue Sep 5, 2024
Merged via the queue into operator-framework:master with commit 48a856a Sep 5, 2024
11 of 12 checks passed
@grokspawn grokspawn deleted the paginate branch September 5, 2024 20:00
@jianzhangbjz
Copy link
Contributor

LGTM, test pass: https://issues.redhat.com/browse/OCPBUGS-35358
/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants