|
2 | 2 |
|
3 | 3 | import java.util.Collections;
|
4 | 4 | import java.util.HashMap;
|
5 |
| -import java.util.LinkedList; |
6 |
| -import java.util.List; |
7 | 5 | import java.util.Map;
|
8 | 6 | import java.util.Optional;
|
| 7 | +import java.util.stream.Collectors; |
9 | 8 |
|
10 | 9 | import org.slf4j.Logger;
|
11 | 10 | import org.slf4j.LoggerFactory;
|
|
37 | 36 | import io.javaoperatorsdk.operator.api.reconciler.dependent.Deleter;
|
38 | 37 | import io.javaoperatorsdk.operator.api.reconciler.dependent.DependentResource;
|
39 | 38 | import io.javaoperatorsdk.operator.api.reconciler.dependent.EventSourceProvider;
|
| 39 | +import io.javaoperatorsdk.operator.api.reconciler.dependent.ReconcileResult; |
40 | 40 | import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.DependentResourceConfigurator;
|
41 | 41 | import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.KubernetesClientAware;
|
42 | 42 | import io.javaoperatorsdk.operator.processing.event.EventSourceManager;
|
@@ -187,7 +187,19 @@ public String successTypeName(UpdateControl<P> result) {
|
187 | 187 | @Override
|
188 | 188 | public UpdateControl<P> execute() throws Exception {
|
189 | 189 | initContextIfNeeded(resource, context);
|
190 |
| - dependents.values().forEach(dependent -> dependent.reconcile(resource, context)); |
| 190 | + final var result = dependents.values().stream() |
| 191 | + .map(dependent -> { |
| 192 | + try { |
| 193 | + return dependent.reconcile(resource, context); |
| 194 | + } catch (Exception e) { |
| 195 | + return ReconcileResult.error(resource, e); |
| 196 | + } |
| 197 | + }); |
| 198 | + |
| 199 | + log.info("Dependents reconciliation:\n{}", |
| 200 | + result |
| 201 | + .map(r -> "\t" + r.toString()) |
| 202 | + .collect(Collectors.joining("\n"))); |
191 | 203 | return reconciler.reconcile(resource, context);
|
192 | 204 | }
|
193 | 205 | });
|
|
0 commit comments