-
Notifications
You must be signed in to change notification settings - Fork 220
feat: Dependent Resources for External Resources #991
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
Conversation
# Conflicts: # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/polling/PollingEventSource.java
# Conflicts: # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/AbstractDependentResource.java # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Updater.java # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java
...amework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Deleter.java
Outdated
Show resolved
Hide resolved
...ain/java/io/javaoperatorsdk/operator/api/reconciler/dependent/AbstractDependentResource.java
Outdated
Show resolved
Hide resolved
...ain/java/io/javaoperatorsdk/operator/api/reconciler/dependent/AbstractDependentResource.java
Outdated
Show resolved
Hide resolved
...amework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Creator.java
Show resolved
Hide resolved
} | ||
return created; | ||
} catch (RuntimeException e) { | ||
if (isEventSourceARecentOperationEventFilter()) { |
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.
Shouldn't the cleanup happen all the time, not only in case of an exception?
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.
This is currently done by handleRecentCreateOrUpdate
what can be confusing I agree, will check and change it
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.
Checked this, the problem is that it needs to be in the same synchonized
block as it is now. Will check once more, but in a separate PR, would rather stick with this now. (when changed the tests started to fail)
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.
Can you create an issue to track this, please? Let's merge this!
...amework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Updater.java
Show resolved
Hide resolved
...javaoperatorsdk/operator/processing/dependent/external/AbstractCachingDependentResource.java
Outdated
Show resolved
Hide resolved
.../javaoperatorsdk/operator/processing/dependent/external/AbstractSimpleDependentResource.java
Outdated
Show resolved
Hide resolved
|
||
import static io.javaoperatorsdk.operator.processing.dependent.external.PollingDependentResource.DEFAULT_POLLING_PERIOD; | ||
|
||
public abstract class PerResourcePollingDependentResource<R, P extends HasMetadata> |
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.
I have to admit that I'm still confused between this class and PollingDependentResource
. Not sure what the differences are and when you'd use one or the other.
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.
The PerResource polls the supplier for every resource separatelly, the Poller just periodically polls an api regardless of the resources in the caches of the ControllerResourceEventSource
.../javaoperatorsdk/operator/processing/event/source/polling/PerResourcePollingEventSource.java
Outdated
Show resolved
Hide resolved
I made small changes that I think improve readability a little. If we can sort out the supply thing, the return values either not being used or returning |
Kudos, SonarCloud Quality Gate passed! |
WIP