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

Drop usage of ManageError and ManageSuccess functions #93

Merged
merged 2 commits into from
Apr 14, 2021

Conversation

roivaz
Copy link
Member

@roivaz roivaz commented Apr 14, 2021

ManageError(...) and ManageSuccess(...) from https://github.com/redhat-cop/operator-utils have functionality to manage the status of the custom resource after each reconcile, either for success or for error situations. We are not currently using this functionality as the status of marin3r custom resources does not support this.

Furthermore, ManageError is causing some spurious panics in reconcile loops when the custom resource cannot be retrieved for some reason. A first look into ManageError seems to point to the problem being that ManageError only restrains itslef from trying to access the fields in the custom resource if the api call returned a "not found" error. The panic occurs when a different api/client error is returned and then the function tries to access the struct, which just holds a nil value. The statement that ends up causing the panic is https://github.com/redhat-cop/operator-utils/blob/eca9bb2b140c4a08a13a5c570d5cdbcaa15a48b3/pkg/util/lockedresourcecontroller/resource-reconciler.go#L233

ManageError(...) and ManageSuccess(...) from https://github.com/redhat-cop/operator-utils have functionality to manage the status of the custom resource after each reconcile, either for success or for error situations. We are not currently using this functionality as the status of marin3r custom resources does not support this.

Furthermore, ManageError is causing some spurious panics in reconcile loops when the custom resource cannot be retrieved for some reason. A first look into ManageError seems to point to the problem being that ManageError only restrains itslef from trying to access the fields in the custom resource if the api call returned a "not found" error. The panic occurs when a different api/client error is returned and then the function tries to access the struct, which just holds a nil value. The statement that ends up causing the panic is https://github.com/redhat-cop/operator-utils/blob/eca9bb2b140c4a08a13a5c570d5cdbcaa15a48b3/pkg/util/lockedresourcecontroller/resource-reconciler.go#L233
@3scale-robot 3scale-robot added the needs-kind Indicates a PR or issue lacks a `kind/foo` label and requires one. label Apr 14, 2021
@3scale-robot
Copy link
Contributor

@roivaz: There are no kind on this issue.
Please add an appropriate kind by using one of the following commands:

  • /kind bug
  • /kind cleanup
  • /kind documentation
  • /kind feature
  • /kind <kind-name>

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.

@3scale-robot 3scale-robot added needs-priority Indicates a PR or issue lacks a `priority/foo` label and requires one. needs-size Indicates a PR or issue lacks a `size/foo` label and requires one. labels Apr 14, 2021
@roivaz
Copy link
Member Author

roivaz commented Apr 14, 2021

/kind bug
/priority important-longterm

@3scale-robot 3scale-robot added kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple sprints to complete. and removed needs-kind Indicates a PR or issue lacks a `kind/foo` label and requires one. needs-priority Indicates a PR or issue lacks a `priority/foo` label and requires one. labels Apr 14, 2021
@roivaz roivaz added the size/XS Requires less than an hour to complete the PR or the issue. label Apr 14, 2021
@3scale-robot 3scale-robot removed the needs-size Indicates a PR or issue lacks a `size/foo` label and requires one. label Apr 14, 2021
@roivaz
Copy link
Member Author

roivaz commented Apr 14, 2021

/ok-to-test

@3scale-robot 3scale-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 14, 2021
Copy link
Contributor

@raelga raelga left a comment

Choose a reason for hiding this comment

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

/lgtm

@3scale-robot 3scale-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2021
@3scale-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6a2fd8fa8642a751df47a7e46369f4f7ed77cf4c

@slopezz
Copy link
Member

slopezz commented Apr 14, 2021

/lgtm

@roivaz
Copy link
Member Author

roivaz commented Apr 14, 2021

/approve

@3scale-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roivaz

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

@3scale-robot 3scale-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2021
@3scale-robot 3scale-robot merged commit 340124f into main Apr 14, 2021
@3scale-robot 3scale-robot deleted the fix/drop-manageerror-usage branch April 14, 2021 14:42
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple sprints to complete. size/XS Requires less than an hour to complete the PR or the issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants