Skip to content

Commit 5354c9f

Browse files
committed
feat: initial support for @configured and build-time computed workflows
Requires operator-framework/java-operator-sdk#1647
1 parent ac9b75e commit 5354c9f

File tree

15 files changed

+314
-287
lines changed

15 files changed

+314
-287
lines changed

common-deployment/src/main/java/io/quarkiverse/operatorsdk/common/AnnotatableDependentResourceAugmentedClassInfo.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

common-deployment/src/main/java/io/quarkiverse/operatorsdk/common/ClassUtils.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.quarkiverse.operatorsdk.common;
22

33
import static io.quarkiverse.operatorsdk.common.Constants.ANNOTATION_CONFIGURABLE;
4-
import static io.quarkiverse.operatorsdk.common.Constants.ANNOTATION_DR_CONFIGURATOR;
54
import static io.quarkiverse.operatorsdk.common.Constants.CUSTOM_RESOURCE;
65
import static io.quarkiverse.operatorsdk.common.Constants.DEPENDENT_RESOURCE;
76
import static io.quarkiverse.operatorsdk.common.Constants.OBJECT;
@@ -70,9 +69,11 @@ static SelectiveAugmentedClassInfo createAugmentedClassInfoFor(DotName implement
7069
return new AnnotationConfigurableAugmentedClassInfo(classInfo);
7170
} else if (CUSTOM_RESOURCE.equals(implementedOrExtendedClass)) {
7271
return new CustomResourceAugmentedClassInfo(classInfo, null);
73-
} else if (ANNOTATION_DR_CONFIGURATOR.equals(implementedOrExtendedClass)) {
74-
return new AnnotatableDependentResourceAugmentedClassInfo(classInfo);
75-
} else {
72+
} /*
73+
* else if (ANNOTATION_DR_CONFIGURATOR.equals(implementedOrExtendedClass)) {
74+
* return new AnnotatableDependentResourceAugmentedClassInfo(classInfo);
75+
* }
76+
*/ else {
7677
throw new IllegalArgumentException("Don't know how to process " + implementedOrExtendedClass);
7778
}
7879
}

common-deployment/src/main/java/io/quarkiverse/operatorsdk/common/Constants.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
import io.javaoperatorsdk.operator.api.reconciler.Ignore;
1010
import io.javaoperatorsdk.operator.api.reconciler.Reconciler;
1111
import io.javaoperatorsdk.operator.api.reconciler.dependent.DependentResource;
12-
import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.AnnotationDependentResourceConfigurator;
13-
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependent;
14-
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResource;
1512

1613
public class Constants {
1714
private Constants() {
@@ -22,15 +19,9 @@ private Constants() {
2219
public static final DotName CUSTOM_RESOURCE = DotName.createSimple(CustomResource.class.getName());
2320
public static final DotName HAS_METADATA = DotName.createSimple(HasMetadata.class.getName());
2421
public static final DotName CONTROLLER_CONFIGURATION = DotName.createSimple(ControllerConfiguration.class.getName());
25-
public static final DotName KUBERNETES_DEPENDENT_RESOURCE = DotName
26-
.createSimple(KubernetesDependentResource.class.getName());
27-
public static final DotName KUBERNETES_DEPENDENT = DotName.createSimple(KubernetesDependent.class.getName());
28-
2922
public static final DotName DEPENDENT_RESOURCE = DotName.createSimple(DependentResource.class.getName());
3023

3124
public static final DotName ANNOTATION_CONFIGURABLE = DotName.createSimple(AnnotationConfigurable.class.getName());
32-
public static final DotName ANNOTATION_DR_CONFIGURATOR = DotName
33-
.createSimple(AnnotationDependentResourceConfigurator.class.getName());
3425

3526
public static final DotName OBJECT = DotName.createSimple(Object.class.getName());
3627
}

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.fasterxml.jackson.databind.ObjectMapper;
2222

2323
import io.javaoperatorsdk.operator.api.config.ConfigurationService;
24-
import io.quarkiverse.operatorsdk.common.AnnotatableDependentResourceAugmentedClassInfo;
2524
import io.quarkiverse.operatorsdk.common.AnnotationConfigurableAugmentedClassInfo;
2625
import io.quarkiverse.operatorsdk.common.ClassUtils;
2726
import io.quarkiverse.operatorsdk.common.ConfigurationUtils;
@@ -153,11 +152,13 @@ ConfigurationServiceBuildItem createConfigurationServiceAndOperator(
153152
.peek(ci -> registerForReflection.addAll(ci.getClassNamesToRegisterForReflection()))
154153
.collect(Collectors.toMap(ac -> ac.classInfo().name().toString(), Function.identity()));
155154

156-
final var annotatableDRInfos = ClassUtils
157-
.getProcessableImplementationsOf(Constants.ANNOTATION_DR_CONFIGURATOR, index, log, Collections.emptyMap())
158-
.map(AnnotatableDependentResourceAugmentedClassInfo.class::cast)
159-
.peek(ci -> registerForReflection.addAll(ci.getClassNamesToRegisterForReflection()))
160-
.collect(Collectors.toMap(ac -> ac.classInfo().name().toString(), Function.identity()));
155+
/*
156+
* final var annotatableDRInfos = ClassUtils
157+
* .getProcessableImplementationsOf(Constants.ANNOTATION_DR_CONFIGURATOR, index, log, Collections.emptyMap())
158+
* .map(AnnotatableDependentResourceAugmentedClassInfo.class::cast)
159+
* .peek(ci -> registerForReflection.addAll(ci.getClassNamesToRegisterForReflection()))
160+
* .collect(Collectors.toMap(ac -> ac.classInfo().name().toString(), Function.identity()));
161+
*/
161162

162163
// retrieve the known CRD information to make sure we always have a full view
163164
var stored = liveReload.getContextObject(ContextStoredCRDInfos.class);
@@ -199,7 +200,7 @@ ConfigurationServiceBuildItem createConfigurationServiceAndOperator(
199200
}
200201
}
201202

202-
return builder.build(raci, configurableInfos, annotatableDRInfos);
203+
return builder.build(raci, configurableInfos);
203204
})
204205
.collect(Collectors.toList());
205206

0 commit comments

Comments
 (0)