Skip to content

Commit f36e10c

Browse files
committed
progress
Signed-off-by: Attila Mészáros <csviri@gmail.com>
1 parent cb9e645 commit f36e10c

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public Optional<Condition<R, P>> getDeletePostcondition() {
6565
return Optional.ofNullable(deletePostcondition);
6666
}
6767

68+
public Optional<Condition<R, P>> getActivationCondition() {
69+
return Optional.ofNullable(activationCondition);
70+
}
71+
6872
void setReconcilePrecondition(Condition<R, P> reconcilePrecondition) {
6973
this.reconcilePrecondition = reconcilePrecondition;
7074
}
@@ -73,6 +77,10 @@ void setDeletePostcondition(Condition<R, P> cleanupCondition) {
7377
this.deletePostcondition = cleanupCondition;
7478
}
7579

80+
void setActivationCondition(Condition<R, P> activationCondition) {
81+
this.activationCondition = activationCondition;
82+
}
83+
7684
public Optional<Condition<R, P>> getReadyPostcondition() {
7785
return Optional.ofNullable(readyPostcondition);
7886
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public WorkflowBuilder<P> withDeletePostcondition(Condition deletePostcondition)
5858
return this;
5959
}
6060

61+
public WorkflowBuilder<P> withActivationCondition(Condition activationCondition) {
62+
currentNode.setActivationCondition(activationCondition);
63+
return this;
64+
}
65+
6166
DependentResourceNode getNodeByDependentResource(DependentResource<?, ?> dependentResource) {
6267
// first check by name
6368
final var node =

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ public <R> List<ResourceEventSource<R, P>> getResourceEventSourcesFor(Class<R> d
231231
return eventSources.getEventSources(dependentType);
232232
}
233233

234+
@Override
235+
public void dynamicallyRegisterEventSource(String name, EventSource eventSource) {
236+
// todo not that other thread should wait for syncing (with start() within synchronized this is
237+
// automatically ensured)
238+
}
239+
240+
@Override
241+
public void dynamicallyDeRegisterEventSource(String name) {
242+
// todo
243+
}
244+
234245
/**
235246
* @deprecated Use {@link #getResourceEventSourceFor(Class)} instead
236247
*

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceRetriever.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.List;
44

55
import io.fabric8.kubernetes.api.model.HasMetadata;
6+
import io.javaoperatorsdk.operator.processing.event.source.EventSource;
67
import io.javaoperatorsdk.operator.processing.event.source.ResourceEventSource;
78

89
public interface EventSourceRetriever<P extends HasMetadata> {
@@ -15,4 +16,9 @@ default <R> ResourceEventSource<R, P> getResourceEventSourceFor(Class<R> depende
1516

1617
<R> List<ResourceEventSource<R, P>> getResourceEventSourcesFor(Class<R> dependentType);
1718

19+
// todo javadocs
20+
// this will be an idempotent synchronized operation
21+
void dynamicallyRegisterEventSource(String name, EventSource eventSource);
22+
23+
void dynamicallyDeRegisterEventSource(String name);
1824
}

0 commit comments

Comments
 (0)