Skip to content

Commit be2a8e0

Browse files
committed
fix: informer should have a default name even without explicit config
Signed-off-by: Chris Laprun <claprun@redhat.com>
1 parent 8b6b321 commit be2a8e0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentConverter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,15 @@ private InformerConfiguration<R> createInformerConfiguration(KubernetesDependent
8181
InformerConfiguration.from(resourceType, controllerConfig.getResourceClass());
8282
}
8383

84-
if (configAnnotation != null && configAnnotation.informerConfig() != null) {
84+
// default name should be set even if there's no explicit informer configuration
85+
informerConfig.withName(DependentResource.defaultNameFor(dependentResourceClass));
8586

87+
if (configAnnotation != null && configAnnotation.informerConfig() != null) {
88+
// override default name if more specific one is provided
8689
if (!Constants.NO_VALUE_SET.equals(configAnnotation.informerConfig().name())) {
8790
informerConfig.withName(configAnnotation.informerConfig().name());
8891
} else if (spec.getName() != null && !Constants.NO_VALUE_SET.equals(spec.getName())) {
8992
informerConfig.withName(spec.getName());
90-
} else {
91-
informerConfig.withName(DependentResource.defaultNameFor(dependentResourceClass));
9293
}
9394

9495
var namespaces = Set.of(configAnnotation.informerConfig().namespaces());

0 commit comments

Comments
 (0)