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

Return an error when the IP status cannot be updated #3410

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Oct 8, 2024

This status update function was not returning an error when an error occured, and could lead to a crash due returning nil for the IP.

Description of the change:

Motivation for the change:

Architectural changes:

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

This status update function was not returning an error when an error
occured, and could lead to a crash due returning nil for the IP.

Signed-off-by: Todd Short <[email protected]>
logger.Errorf("error updating InstallPlan status")
return nil, nil
logger.WithError(err).Error("error updating InstallPlan status")
return nil, fmt.Errorf("error updating InstallPlan status: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think the error should be opaque here: I do not see a reason for wrapping.

@tmshort tmshort added this pull request to the merge queue Oct 10, 2024
Merged via the queue into operator-framework:master with commit a63b449 Oct 10, 2024
12 checks passed
@tmshort tmshort deleted the avoid-crash branch October 11, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants