Skip to content

Commit

Permalink
fix: only index target class, not turning runtime into a bean archive
Browse files Browse the repository at this point in the history
Adding a beans.xml file turns the module into a bean archive in
addition of forcing indexing. This has unintended consequences if the
module contains CDI beans which might get initialized when not ready.

Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Nov 21, 2023
1 parent ba7e323 commit d4c321f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ void setup(BuildProducer<IndexDependencyBuildItem> indexDependency,
BuildProducer<FeatureBuildItem> features,
BuildProducer<UnremovableBeanBuildItem> unremovableBeans,
Optional<MetricsCapabilityBuildItem> metricsCapability,
BuildProducer<AdditionalBeanBuildItem> additionalBeans) {
BuildProducer<AdditionalBeanBuildItem> additionalBeans,
BuildProducer<AdditionalIndexedClassesBuildItem> additionalIndexedClasses) {
features.produce(new FeatureBuildItem(FEATURE));
indexDependency.produce(
new IndexDependencyBuildItem("io.javaoperatorsdk", "operator-framework-core"));
Expand Down Expand Up @@ -88,6 +89,10 @@ void setup(BuildProducer<IndexDependencyBuildItem> indexDependency,

// register health check
additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(OperatorHealthCheck.class));

// register DefaultRateLimiter so that it can properly be configured via RateLimited annotation as expected
additionalIndexedClasses.produce(
new AdditionalIndexedClassesBuildItem(QuarkusControllerConfiguration.DefaultRateLimiter.class.getName()));
}

@BuildStep(onlyIf = IsDevelopment.class)
Expand Down
Empty file.

0 comments on commit d4c321f

Please sign in to comment.