Skip to content

Commit de63f29

Browse files
committed
rename condition to activationCondition
Signed-off-by: Attila Mészáros <csviri@gmail.com>
1 parent a970cd2 commit de63f29

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/BaseConfigurationService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ private static List<DependentResourceSpec> dependentResources(
230230
Utils.instantiate(dependent.readyPostcondition(), Condition.class, context),
231231
Utils.instantiate(dependent.reconcilePrecondition(), Condition.class, context),
232232
Utils.instantiate(dependent.deletePostcondition(), Condition.class, context),
233+
Utils.instantiate(dependent.activationCondition(), Condition.class, context),
233234
eventSourceName);
234235
specsMap.put(dependentName, spec);
235236
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/dependent/DependentResourceSpec.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ public class DependentResourceSpec<R, P extends HasMetadata> {
2222

2323
private final Condition<?, ?> deletePostCondition;
2424

25+
private final Condition<?, ?> activationCondition;
26+
2527
private final String useEventSourceWithName;
2628

2729
public DependentResourceSpec(Class<? extends DependentResource<R, P>> dependentResourceClass,
2830
String name, Set<String> dependsOn, Condition<?, ?> readyCondition,
2931
Condition<?, ?> reconcileCondition, Condition<?, ?> deletePostCondition,
30-
String useEventSourceWithName) {
32+
Condition<?, ?> activationCondition, String useEventSourceWithName) {
3133
this.dependentResourceClass = dependentResourceClass;
3234
this.name = name;
3335
this.dependsOn = dependsOn;
3436
this.readyCondition = readyCondition;
3537
this.reconcileCondition = reconcileCondition;
3638
this.deletePostCondition = deletePostCondition;
39+
this.activationCondition = activationCondition;
3740
this.useEventSourceWithName = useEventSourceWithName;
3841
}
3942

@@ -87,6 +90,11 @@ public Condition getDeletePostCondition() {
8790
return deletePostCondition;
8891
}
8992

93+
@SuppressWarnings("rawtypes")
94+
public Condition getActivationCondition() {
95+
return activationCondition;
96+
}
97+
9098
public Optional<String> getUseEventSourceWithName() {
9199
return Optional.ofNullable(useEventSourceWithName);
92100
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Dependent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
*/
5151
Class<? extends Condition> deletePostcondition() default Condition.class;
5252

53+
Class<? extends Condition> activationCondition() default Condition.class;
54+
5355
/**
5456
* The list of named dependents that need to be reconciled before this one can be.
5557
*

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/DefaultManagedWorkflow.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public Workflow<P> resolve(KubernetesClient client,
8181
spec.getReconcileCondition(),
8282
spec.getDeletePostCondition(),
8383
spec.getReadyCondition(),
84+
spec.getActivationCondition(),
8485
resolve(spec, client, configuration));
8586
alreadyResolved.put(node.getName(), node);
8687
spec.getDependsOn()

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/DependentResourceNode.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ public class DependentResourceNode<R, P extends HasMetadata> {
1616
private Condition<R, P> reconcilePrecondition;
1717
private Condition<R, P> deletePostcondition;
1818
private Condition<R, P> readyPostcondition;
19+
private Condition<R, P> activationCondition;
1920
private final DependentResource<R, P> dependentResource;
2021

2122
DependentResourceNode(DependentResource<R, P> dependentResource) {
22-
this(getNameFor(dependentResource), null, null, null, dependentResource);
23+
this(getNameFor(dependentResource), null, null, null, null, dependentResource);
2324
}
2425

2526
public DependentResourceNode(String name, Condition<R, P> reconcilePrecondition,
2627
Condition<R, P> deletePostcondition, Condition<R, P> readyPostcondition,
27-
DependentResource<R, P> dependentResource) {
28+
Condition<R, P> activationCondition, DependentResource<R, P> dependentResource) {
2829
this.name = name;
2930
this.reconcilePrecondition = reconcilePrecondition;
3031
this.deletePostcondition = deletePostcondition;
3132
this.readyPostcondition = readyPostcondition;
33+
this.activationCondition = activationCondition;
3234
this.dependentResource = dependentResource;
3335
}
3436

0 commit comments

Comments
 (0)