improve: followup PR for Informer Pools - #3541
Conversation
- addresses deprecations - addresses late PR comments for Informer Pools: operator-framework#3325 Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This follow-up PR aligns the codebase with the newer informer pooling / event source APIs by removing now-deprecated InformerEventSource(..., context) construction patterns, and updating related samples, tests, and documentation accordingly.
Changes:
- Update samples, tests, and docs to construct
InformerEventSourcefrom configuration only (noEventSourceContextargument). - Deprecate
InformerEventSourceConfiguration#getGroupVersionKind()in favor ofInformerConfiguration#getResourceGroupVersionKind(). - Adjust
ConfigurationServiceOverrider#withInformerPoolto accept theInformerPoolinterface and update related documentation.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java | Update sample to use the new InformerEventSource(configuration) constructor. |
| sample-operators/tomcat-operator/src/main/java/io/javaoperatorsdk/operator/sample/WebappReconciler.java | Update sample to remove deprecated context constructor argument. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/complexdependent/ComplexWorkflowReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/primarytosecondaydependent/PrimaryToSecondaryDependentReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/primaryindexer/DependentPrimaryIndexerTestReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multiplemanageddependentsametype/MultipleManagedDependentResourceReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multipledrsametypenodiscriminator/MultipleManagedDependentSameTypeNoDiscriminatorReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multipledependentresourcewithsametype/MultipleDependentResourceWithDiscriminatorReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multipledependentresource/MultipleDependentResourceReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalStateReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalStateDependentReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/externalstatebulkdependent/ExternalStateBulkDependentReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/simple/TestReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/secondarytoprimaryreferencechange/TargetReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/resourceoperations/SecondaryResourceOperationsReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/ownsecondaryupdate/OwnSecondaryUpdateReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/onrelistfilter/OnRelistFilterReconciler.java | Update test and inner event source subclass to use new constructor. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalsecondaryupdate/ExternalSecondaryUpdateReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/primarytosecondary/JobReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/primaryindexer/PrimaryIndexerTestReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/ownerreferencemultiversion/OwnerRefMultiVersionReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/multiplesecondaryeventsource/MultipleSecondaryEventSourceReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/latestdistinct/LatestDistinctTestReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerremotecluster/InformerRemoteClusterReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerpool/dynamic/StaticSharedInformerReconciler.java | Update informer-pool integration test reconciler to use new constructor. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerpool/dynamic/DynamicSharedInformerReconciler.java | Update dynamic registration flow to construct event sources without passing context. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerpool/deregister/DeregisterReconciler.java | Update dynamic registration flow to construct event sources without passing context. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerpool/basic/SharedInformerReconciler2.java | Update informer-pool basic test reconciler to use new constructor. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informerpool/basic/SharedInformerReconciler1.java | Update informer-pool basic test reconciler to use new constructor. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/informereventsource/InformerEventSourceTestCustomReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/generickubernetesresourcehandling/GenericKubernetesResourceHandlingReconciler.java | Update generic-resource test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/FilterTestReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/fieldselector/FieldSelectorTestReconciler.java | Update test reconciler to use new informer event source construction. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation/periodicclean/PeriodicCleanerExpectationReconciler.java | Update expectation test to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation/onallevent/ExpectationReconciler.java | Update expectation test to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/dynamicgenericeventsourceregistration/DynamicGenericEventSourceRegistrationReconciler.java | Update dynamic generic registration to construct event sources without passing context. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/createupdateeventfilter/CreateUpdateEventFilterTestReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/clusterscopedresource/ClusterScopedCustomResourceReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace/ChangeNamespaceTestReconciler.java | Update test reconciler to remove deprecated constructor usage. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java | Improve deprecation Javadoc link and ensure deprecated ctor delegates to the new ctor. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java | Update dependent-resource event source creation to use new informer event source constructor. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerEventSourceConfiguration.java | Deprecate getGroupVersionKind() and point to the replacement API. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java | Switch withInformerPool parameter type to InformerPool and adjust docs. |
| docs/content/en/docs/documentation/working-with-es-caches.md | Update documentation snippets for new InformerEventSource constructor usage. |
| docs/content/en/docs/documentation/operations/configuration.md | Update documentation snippet to remove deprecated constructor usage. |
| docs/content/en/docs/documentation/eventing.md | Update documentation snippet to remove deprecated constructor usage. |
| docs/content/en/docs/documentation/event-filters.md | Update documentation snippet to remove deprecated constructor usage. |
| caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java | Update caffeine bounded-cache tests to use new informer event source construction. |
| InformerEventSource<Job,Cluster> clusterInformer = | ||
| new InformerEventSource( | ||
| new InformerEventSource<>( | ||
| InformerEventSourceConfiguration.from(Cluster.class, Job.class) | ||
| .withSecondaryToPrimaryMapper( |
| InformerEventSource<ConfigMap, TestCustomResource> configMapES = | ||
| new InformerEventSource<>(InformerEventSourceConfiguration.from(ConfigMap.class, TestCustomResource.class) | ||
| .withNamespacesInheritedFromController(context) | ||
| .build(), context); | ||
| .build()); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
InformerPoolinstead ofAbstractInformerPoolinConfigurationServiceOverriderSigned-off-by: Attila Mészáros a_meszaros@apple.com