-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
✨ lightweight dependency injection #182
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pwittrock 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 |
@DirectXMan12 WDYT? There are a couple use cases for this:
|
b1157ab
to
3838fe0
Compare
@droot thoughts? |
Took a look. In my mind, the primary use-case for dependency injection for a way to provide user-managed-objects like |
/kind feature |
Here is an example of the problem we are trying to solve: https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/master/cmd/manager/main.go#L78 Take a look at how the actuator is passed around. |
@pwittrock Took a look. our current scaffolding project structure isn't flexible enough for people to initialize |
I found it easier to implement inversion of control by just skipping the SDK boilerplate and using controller-runtime as a library (part of openshift/cluster-ingress-operator#70). In this context, I feel like the underlying problem is not lack of a dependency injection system (i.e. more framework) but instead a more IoC-friendly architecture. That said, I acknowledge that IoC might not be important to everyone and there are many ways to go about it. |
638dd95
to
4dba4c0
Compare
@ironcladlou I mostly agree, though I think we still will need an answer for those who want to work within the framework as structured today. |
PTAL |
No description provided.