File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
operator-framework/src/main/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,25 @@ public class ControllerUtils {
24
24
private static Map <Class <? extends CustomResource >, Class <? extends CustomResourceDoneable <? extends CustomResource >>>
25
25
doneableClassCache = new HashMap <>();
26
26
27
- static String getDefaultFinalizer (ResourceController controller ) {
28
- return getAnnotation (controller ).finalizerName ();
27
+ static String getFinalizer (ResourceController controller ) {
28
+ final String annotationFinalizerName = getAnnotation (controller ).finalizerName ();
29
+ final String finalizerName ;
30
+ if (Controller .NULL .equals (annotationFinalizerName )) {
31
+ finalizerName = controller .getDefaultFinalizerName ();
32
+ if (finalizerName == null ) {
33
+ throw new IllegalStateException ("Controller annotation cannot be used on Local, Anonymous or Hidden classes" );
34
+ }
35
+ } else {
36
+ finalizerName = annotationFinalizerName ;
37
+ }
38
+ return finalizerName ;
29
39
}
30
40
31
41
static boolean getGenerationEventProcessing (ResourceController controller ) {
32
42
return getAnnotation (controller ).generationAwareEventProcessing ();
33
43
}
34
44
35
- static <R extends CustomResource > Class <R > getCustomResourceClass (ResourceController controller ) {
45
+ static <R extends CustomResource > Class <R > getCustomResourceClass (ResourceController < R > controller ) {
36
46
return (Class <R >) getAnnotation (controller ).customResourceClass ();
37
47
}
38
48
You can’t perform that action at this time.
0 commit comments