Skip to content

Dependent Resource Standalone Building Blocks #887

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

Closed
csviri opened this issue Jan 30, 2022 · 0 comments · Fixed by #914
Closed

Dependent Resource Standalone Building Blocks #887

csviri opened this issue Jan 30, 2022 · 0 comments · Fixed by #914

Comments

@csviri
Copy link
Collaborator

csviri commented Jan 30, 2022

This issue is about a design aspect of DependentResources. See other issues by related labels.

The goal in nutshell, is that a DependentResource should be implementation should be usable independently of the controller internal. So something like this should be doable:

@ControllerConfiguration
public class MyReconciler
    implements Reconciler<MyResource>,
    EventSourceInitializer<MyResource> {

  // this will be probably KubernetesDependentResource or similar
  DependentResource<Deployment> dependentResource;

  public MySQLSchemaReconciler(KubernetesClient client) {
      dependentResource = new DependentResource(client, ...)
  }

  @Override
  public List<EventSource> prepareEventSources(
     return List.of(dependentResource.initEventSource())
  }

  @Override
  public UpdateControl<MyResource> reconcile(MyResource schema, Context context) {
       dependentResource.reconcile(schema,context)
  }

Maybe we should differentiate at the end between DependentResource and ManagedDependentResource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant