-
Notifications
You must be signed in to change notification settings - Fork 148
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
components: provide common interface #1375
components: provide common interface #1375
Conversation
Skipping CI for Draft Pull Request. |
653095e
to
4b14d86
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature-operator-refactor #1375 +/- ##
============================================================
Coverage ? 26.85%
============================================================
Files ? 55
Lines ? 4428
Branches ? 0
============================================================
Hits ? 1189
Misses ? 3098
Partials ? 141 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
5769724
to
eb46cb8
Compare
/cc @lburgazzoli |
} | ||
componentErrors := cr.ForEach(func(component cr.ComponentHandler) error { | ||
var err error | ||
// TODO: check instance updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be revisited, e2e-tests shows problem here.
eb46cb8
to
d071556
Compare
d071556
to
c13a9f3
Compare
c13a9f3
to
39a476f
Compare
Decouple components and main code of operator with ComponentHandler interface. It allows to hanle all common operations in a unique way and add components without changing main/dsc code. At the moment they are initialization, controller creation and fetching some component specific values (name, management status and corresponding CR). For the latter the code basically copy'n'paste unfortunately. Use init() functionality to register components only. It requires linter silencing and explicit importing them in main.go otherwise init() is not called. Non-recommended approach (and linter silencing) of returning interface is used to return component specific CR as common client.Object to simplify the code in DSC reconciler. Otherwise one more level of inderection is needed with passing required functionality (closure) to the interface function. Signed-off-by: Yauheni Kaliuta <[email protected]>
39a476f
to
c6a4c3e
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lburgazzoli 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 |
/hold |
@ykaliuta set to "on hold" just to avoid disruption on other components, I'll update the PR with the new component as they re merged if you agree |
Up to you, but I think it should go other way around. It's a pretty small change to a component to rebase on top on it. |
/unhold |
d044d64
into
opendatahub-io:feature-operator-refactor
Decouple components and main code of operator with ComponentHandler
interface. It allows to hanle all common operations in a unique way
and add components without changing main/dsc code. At the moment
they are initialization, controller creation and fetching some
component specific values (name, management status and corresponding
CR). For the latter the code basically copy'n'paste unfortunately.
Use init() functionality to register components only. It requires
linter silencing and explicit importing them in main.go otherwise
init() is not called.
Also non-recommended approach (and linter silencing) of returning
interface is used to return component specific CR as common
client.Object to simplify the code in DSC reconciler. Otherwise one
more level of indirection is needed with passing required
functionality (closure) to the interface function.
Signed-off-by: Yauheni Kaliuta [email protected]
Description
How Has This Been Tested?
Screenshot or short clip
Merge criteria