Skip to content

Conversation

@AlexNPavel
Copy link
Contributor

Description of the change: Add basic multi-CR support for operator-sdk scorecard. This also adds a new CR to the test/test-framework, that is the has identical functionality as the original but uses replica sets, for testing (which is why this PR is so large; much of it is just adding another CR to memcached-operator).

Motivation for the change: See issue #984.

While this PR will add some early, basic support for multiple CRs in the scorecard, there are some major difficulties for many operators that implement multiple CRs. The scorecard assumes that the CR being created will result in the operator responding and creating/modifying resources. However, in many operators with multiple CRDs, the additional CRDs are more of a helper resource rather than the full definition of an application. This can be seen in the metering operator for example. The metering operator has 7 CRDs in total, and many of them are not intended to be run individually. The PrestoTable CRD specifically mentions that it's used "Under the hood" in its description.

This leads to some big problems as we cannot treat multi-CR operators the same as we do single-CR operators. How to handle multi-CR operators beyond what this PR does (just running the same tests on each CR independently) will require more discussion.

@AlexNPavel AlexNPavel added kind/feature Categorizes issue or PR as related to a new feature. scorecard Issue relates to the scorecard subcomponent labels Mar 22, 2019
@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 22, 2019
@estroz
Copy link
Member

estroz commented Mar 27, 2019

There's extra work to be done for OLM-deployed operators with multiple CR's, but I'll do that in a follow-up PR.

@AlexNPavel
Copy link
Contributor Author

This is ready for review.

/cc @joelanford @hasbro17 @estroz

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Did a quick review and looks pretty good! I still need to spend more time trying it out.

@AlexNPavel
Copy link
Contributor Author

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Looks good, a few questions.

Copy link
Member

@estroz estroz 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 Apr 30, 2019
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Just some minor pointer-related suggestions and a question about how one of the scenarios with multiple CRs in the CSV resources test.

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

New changes are detected. LGTM label has been removed.

}

// Run - implements Test interface
func (t *CRDsHaveResourcesTest) Run(ctx context.Context) *TestResult {
Copy link
Member

@joelanford joelanford May 2, 2019

Choose a reason for hiding this comment

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

I missed this pointer return yesterday. Can we return a TestResult here? If so, I guess this would apply to all of the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we can change that to return the struct instead of a struct pointer. It's outside of the scope of changes in this PR though, so I'll do that in a separate PR.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexNPavel AlexNPavel merged commit 690cc27 into operator-framework:master May 2, 2019
@AlexNPavel AlexNPavel deleted the sc-multi-cr branch May 2, 2019 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. scorecard Issue relates to the scorecard subcomponent size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants