-
Notifications
You must be signed in to change notification settings - Fork 220
refactor: renaming core classes and APIs #646
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
Changes from 5 commits
d478e35
3b76d5e
5919eac
74920ab
3f92747
fb58685
55b859d
6f07321
444f7d1
8b1be24
424f800
adc543a
1d148ac
9ec3471
910293a
349fc11
2e0ec8b
75b8e0e
8811dc3
224bcdf
94980ee
cadbc8a
0f9eaba
725fb06
b51e69b
0521f8e
4105def
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ | |
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.Version; | ||
import io.javaoperatorsdk.operator.api.LifecycleAware; | ||
import io.javaoperatorsdk.operator.api.ResourceController; | ||
import io.javaoperatorsdk.operator.api.config.ConfigurationService; | ||
import io.javaoperatorsdk.operator.api.config.ControllerConfiguration; | ||
import io.javaoperatorsdk.operator.api.config.ExecutorServiceManager; | ||
import io.javaoperatorsdk.operator.api.reconciler.Reconciler; | ||
import io.javaoperatorsdk.operator.processing.ConfiguredController; | ||
|
||
@SuppressWarnings("rawtypes") | ||
|
@@ -114,9 +114,9 @@ public void close() { | |
* @param <R> the {@code CustomResource} type associated with the controller | ||
* @throws OperatorException if a problem occurred during the registration process | ||
*/ | ||
public <R extends CustomResource<?, ?>> void register(ResourceController<R> controller) | ||
public <R extends CustomResource<?, ?>> void registerController(Reconciler<R> controller) | ||
throws OperatorException { | ||
register(controller, null); | ||
registerController(controller, null); | ||
} | ||
|
||
/** | ||
|
@@ -126,28 +126,28 @@ public void close() { | |
* passing it the controller's original configuration. The effective registration of the | ||
* controller is delayed till the operator is started. | ||
* | ||
* @param controller the controller to register | ||
* @param reconciler part of the controller to register | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that if we do this change, we need to remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Answered above, the controller. Reconciler is just the logic how to reconciler, but this is basically same in controller runtime, the controller is the whole , reconciler is just part of it. |
||
* @param configuration the configuration with which we want to register the controller, if {@code | ||
* null}, the controller's original configuration is used | ||
* @param <R> the {@code CustomResource} type associated with the controller | ||
* @throws OperatorException if a problem occurred during the registration process | ||
*/ | ||
public <R extends CustomResource<?, ?>> void register( | ||
ResourceController<R> controller, ControllerConfiguration<R> configuration) | ||
public <R extends CustomResource<?, ?>> void registerController( | ||
Reconciler<R> reconciler, ControllerConfiguration<R> configuration) | ||
throws OperatorException { | ||
final var existing = configurationService.getConfigurationFor(controller); | ||
final var existing = configurationService.getConfigurationFor(reconciler); | ||
if (existing == null) { | ||
throw new OperatorException( | ||
"Cannot register controller with name " + controller.getClass().getCanonicalName() + | ||
" controller named " + ControllerUtils.getNameFor(controller) | ||
"Cannot register controller with name " + reconciler.getClass().getCanonicalName() + | ||
" controller named " + ControllerUtils.getNameFor(reconciler) | ||
+ " because its configuration cannot be found.\n" + | ||
" Known controllers are: " + configurationService.getKnownControllerNames()); | ||
} else { | ||
if (configuration == null) { | ||
configuration = existing; | ||
} | ||
final var configuredController = | ||
new ConfiguredController<>(controller, configuration, kubernetesClient); | ||
new ConfiguredController<>(reconciler, configuration, kubernetesClient); | ||
controllers.add(configuredController); | ||
|
||
final var watchedNS = | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,14 @@ | |
|
||
import io.fabric8.kubernetes.client.CustomResource; | ||
import io.javaoperatorsdk.operator.ControllerUtils; | ||
import io.javaoperatorsdk.operator.api.Controller; | ||
import io.javaoperatorsdk.operator.api.reconciler.Controller; | ||
import io.javaoperatorsdk.operator.processing.event.internal.CustomResourceEventFilter; | ||
import io.javaoperatorsdk.operator.processing.event.internal.CustomResourceEventFilters; | ||
|
||
public interface ControllerConfiguration<R extends CustomResource<?, ?>> { | ||
|
||
default String getName() { | ||
return ControllerUtils.getDefaultResourceControllerName(getAssociatedControllerClassName()); | ||
return ControllerUtils.getDefaultReconcilerName(getAssociatedControllerClassName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
default String getCRDName() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.javaoperatorsdk.operator.api.reconciler; | ||
|
||
import io.fabric8.kubernetes.client.CustomResource; | ||
import io.javaoperatorsdk.operator.processing.event.EventSourceRegistry; | ||
|
||
public interface EventSourceInitializer<T extends CustomResource<?, ?>> { | ||
|
||
/** | ||
* In this typically you might want to register event sources. But can access | ||
* CustomResourceEventSource, what might be handy for some edge cases. | ||
* | ||
* @param eventSourceRegistry the {@link EventSourceRegistry} where event sources can be | ||
* registered. | ||
*/ | ||
void prepareEventSources(EventSourceRegistry<T> eventSourceRegistry); | ||
|
||
} |
Uh oh!
There was an error while loading. Please reload this page.