Skip to content

Commit 75ed66f

Browse files
metacosmcsviri
authored andcommitted
fix: provide missing getter for recordable constructor parameter
Quarkus recordable constructors require a getter for each named parameter, with the appropriate type. In this case, the parameter was named informerListLimit and of type Long while the corresponding getter was returning Optional<Long>, hence the mismatch.
1 parent bd0a667 commit 75ed66f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/QuarkusControllerConfigurationBuildStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ static QuarkusControllerConfiguration createConfiguration(
248248
resourceFullName,
249249
primaryAsResource.version(),
250250
configExtractor.generationAware(),
251-
resourceClass, null,
251+
resourceClass,
252+
null,
252253
namespaces,
253254
wereNamespacesSet,
254255
getFinalizer(controllerAnnotation, resourceFullName),

core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusControllerConfiguration.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public QuarkusControllerConfiguration(
9898
String resourceTypeName,
9999
String crVersion, boolean generationAware,
100100
Class resourceClass,
101-
Long informerListLimit,
101+
Long nullableInformerListLimit,
102102
Set<String> namespaces,
103103
boolean wereNamespacesSet,
104104
String finalizerName, String labelSelector,
@@ -115,7 +115,7 @@ public QuarkusControllerConfiguration(
115115
this.crVersion = crVersion;
116116
this.generationAware = generationAware;
117117
this.resourceClass = resourceClass;
118-
this.informerListLimit = Optional.ofNullable(informerListLimit);
118+
this.informerListLimit = Optional.ofNullable(nullableInformerListLimit);
119119
this.dependentsMetadata = dependentsMetadata;
120120
this.workflow = workflow;
121121
this.retryConfiguration = ControllerConfiguration.super.getRetryConfiguration();
@@ -160,6 +160,12 @@ public Optional<Long> getInformerListLimit() {
160160
return informerListLimit;
161161
}
162162

163+
@SuppressWarnings("unused")
164+
// this is needed by Quarkus for the RecordableConstructor
165+
public Long getNullableInformerListLimit() {
166+
return informerListLimit.orElse(null);
167+
}
168+
163169
@Override
164170
public String getName() {
165171
return name;

0 commit comments

Comments
 (0)