|
1 | | -package com.github.containersolutions.operator; |
| 1 | +package io.javaoperatorsdk.operator; |
2 | 2 |
|
3 | | -import com.github.containersolutions.operator.api.ResourceController; |
4 | | -import com.github.containersolutions.operator.processing.EventDispatcher; |
5 | | -import com.github.containersolutions.operator.processing.EventScheduler; |
6 | | -import com.github.containersolutions.operator.processing.retry.GenericRetry; |
7 | | -import com.github.containersolutions.operator.processing.retry.Retry; |
| 3 | +import io.javaoperatorsdk.operator.api.ResourceController; |
| 4 | +import io.javaoperatorsdk.operator.processing.EventDispatcher; |
| 5 | +import io.javaoperatorsdk.operator.processing.EventScheduler; |
| 6 | +import io.javaoperatorsdk.operator.processing.retry.GenericRetry; |
| 7 | +import io.javaoperatorsdk.operator.processing.retry.Retry; |
8 | 8 | import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; |
9 | 9 | import io.fabric8.kubernetes.client.CustomResource; |
10 | 10 | import io.fabric8.kubernetes.client.CustomResourceDoneable; |
|
21 | 21 | import java.util.HashMap; |
22 | 22 | import java.util.Map; |
23 | 23 |
|
24 | | -import static com.github.containersolutions.operator.ControllerUtils.*; |
25 | | - |
26 | 24 | @SuppressWarnings("rawtypes") |
27 | 25 | public class Operator { |
28 | 26 |
|
@@ -54,11 +52,11 @@ public <R extends CustomResource> void registerController(ResourceController<R> |
54 | 52 | @SuppressWarnings("rawtypes") |
55 | 53 | private <R extends CustomResource> void registerController(ResourceController<R> controller, |
56 | 54 | boolean watchAllNamespaces, Retry retry, String... targetNamespaces) throws OperatorException { |
57 | | - Class<R> resClass = getCustomResourceClass(controller); |
| 55 | + Class<R> resClass = ControllerUtils.getCustomResourceClass(controller); |
58 | 56 | CustomResourceDefinitionContext crd = getCustomResourceDefinitionForController(controller); |
59 | 57 | KubernetesDeserializer.registerCustomKind(crd.getVersion(), crd.getKind(), resClass); |
60 | | - String finalizer = getDefaultFinalizer(controller); |
61 | | - MixedOperation client = k8sClient.customResources(crd, resClass, CustomResourceList.class, getCustomResourceDoneableClass(controller)); |
| 58 | + String finalizer = ControllerUtils.getDefaultFinalizer(controller); |
| 59 | + MixedOperation client = k8sClient.customResources(crd, resClass, CustomResourceList.class, ControllerUtils.getCustomResourceDoneableClass(controller)); |
62 | 60 | EventDispatcher eventDispatcher = new EventDispatcher(controller, |
63 | 61 | finalizer, new EventDispatcher.CustomResourceFacade(client), ControllerUtils.getGenerationEventProcessing(controller)); |
64 | 62 | EventScheduler eventScheduler = new EventScheduler(eventDispatcher, retry); |
@@ -87,7 +85,7 @@ private <R extends CustomResource> void registerWatches(ResourceController<R> co |
87 | 85 | } |
88 | 86 |
|
89 | 87 | private CustomResourceDefinitionContext getCustomResourceDefinitionForController(ResourceController controller) { |
90 | | - String crdName = getCrdName(controller); |
| 88 | + String crdName = ControllerUtils.getCrdName(controller); |
91 | 89 | CustomResourceDefinition customResourceDefinition = k8sClient.customResourceDefinitions().withName(crdName).get(); |
92 | 90 | if (customResourceDefinition == null) { |
93 | 91 | throw new OperatorException("Cannot find Custom Resource Definition with name: " + crdName); |
|
0 commit comments