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

Skip catalog discover when operator is not found in OperandRegistry #1050

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

Daniel-Fan
Copy link
Contributor

What this PR does / why we need it:
When operator is not found in OperandRegistry, opt is nil and there should be no catalog discovery for this nil object.

Which issue(s) this PR fixes:
Fixes https://github.ibm.com/IBMPrivateCloud/roadmap/issues/63690#issuecomment-81218953

Test

See comment https://github.ibm.com/IBMPrivateCloud/roadmap/issues/63690#issuecomment-81222501

if err != nil {
return nil, err
}
if opt != nil {
Copy link
Member

Choose a reason for hiding this comment

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

suggest to invert the condition, so that if opt is nil, then return nil. Will be easier to read the code, and best practice is to return as early as possible.

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>
Copy link
Member

@bitscuit bitscuit left a comment

Choose a reason for hiding this comment

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

/lgtm

@ibm-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bitscuit, Daniel-Fan

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:
  • OWNERS [Daniel-Fan,bitscuit]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibm-ci-bot ibm-ci-bot merged commit 330494d into IBM:master Jun 3, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants