File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
operator-framework/src/main/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 3
3
import io .fabric8 .kubernetes .client .CustomResource ;
4
4
import io .javaoperatorsdk .operator .api .Controller ;
5
5
import io .javaoperatorsdk .operator .api .ResourceController ;
6
- import org .slf4j .Logger ;
7
- import org .slf4j .LoggerFactory ;
8
6
9
7
10
8
public class ControllerUtils {
11
-
12
- private final static double JAVA_VERSION = Double .parseDouble (System .getProperty ("java.specification.version" ));
13
9
private static final String FINALIZER_NAME_SUFFIX = "/finalizer" ;
14
10
15
11
static String getFinalizer (ResourceController controller ) {
16
12
final String annotationFinalizerName = getAnnotation (controller ).finalizerName ();
17
13
if (!Controller .NULL .equals (annotationFinalizerName )) {
18
14
return annotationFinalizerName ;
19
15
}
20
- final String crdName = getAnnotation (controller ).crdName () + FINALIZER_NAME_SUFFIX ;
21
- return crdName ;
16
+ return controller .getClass ().getCanonicalName () + FINALIZER_NAME_SUFFIX ;
22
17
}
23
18
24
19
static boolean getGenerationEventProcessing (ResourceController controller ) {
@@ -36,8 +31,4 @@ static String getCrdName(ResourceController controller) {
36
31
private static Controller getAnnotation (ResourceController controller ) {
37
32
return controller .getClass ().getAnnotation (Controller .class );
38
33
}
39
-
40
- public static boolean hasGivenFinalizer (CustomResource resource , String finalizer ) {
41
- return resource .getMetadata ().getFinalizers () != null && resource .getMetadata ().getFinalizers ().contains (finalizer );
42
- }
43
34
}
You can’t perform that action at this time.
0 commit comments