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

Error handling for FindCatalogSourceByName #1044

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

nasark
Copy link
Member

@nasark nasark commented Jan 29, 2024

The FindCatalogSourceByName was returning an empty catalog source object if the catalog source was not found instead of returning nil i.e. (from debug logging)

{"result": {"metadata":{"creationTimestamp":null},"spec":{"sourceType":"","icon":{"base64data":"","mediatype":""}},"status":{}}}

This was nullifying the openshift checks we have in place for deploying the strimzi operator https://github.com/ManageIQ/manageiq-pods/blob/master/manageiq-operator/internal/controller/manageiq_controller.go#L529

In addition it was found that the following error is thrown if performing a client.Get() call on a resource for which the CRDs are not installed (instead of throwing errors.IsNotFound()):

failed to get restmapping: no matches for kind \"CatalogSource\" in group \"operators.coreos.com\"

This occurs when using plain k8s as the openshift CRDs (operators.coreos.com) are not installed

@miq-bot add_labels bug, quinteros/yes?
@miq-bot assign @bdunne
@miq-bot add_reviewer @Fryguy

Ref: #1043

@miq-bot
Copy link
Member

miq-bot commented Jan 29, 2024

Checked commit nasark@6bbdbe3 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@bdunne bdunne merged commit 0d1c69b into ManageIQ:master Jan 30, 2024
2 checks passed
@Fryguy
Copy link
Member

Fryguy commented Jan 31, 2024

Backported to quinteros in commit 0b59f67.

commit 0b59f6762f7fc60d648ec23c83bacfbbb1bbb765
Author: Brandon Dunne <brandondunne@hotmail.com>
Date:   Tue Jan 30 16:32:25 2024 -0500

    Merge pull request #1044 from nasark/findcatalogsource_error_handling
    
    Error handling for FindCatalogSourceByName
    
    (cherry picked from commit 0d1c69b871f5deb3b7a2038a06f30d7b1fffb426)

Fryguy pushed a commit that referenced this pull request Jan 31, 2024
Error handling for FindCatalogSourceByName

(cherry picked from commit 0d1c69b)
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.

None yet

4 participants