diff --git a/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java b/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java index 021894bc..6fa7def8 100644 --- a/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java +++ b/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java @@ -39,21 +39,19 @@ public void initContext(ExposedApp exposedApp, Context context) { public UpdateControl reconcile(ExposedApp exposedApp, Context context) { final var name = exposedApp.getMetadata().getName(); // retrieve the workflow reconciliation result and re-schedule if we have dependents that are not yet ready - return context.managedDependentResourceContext().getWorkflowReconcileResult() - .map(wrs -> { - if (wrs.allDependentResourcesReady()) { + final var wrs = context.managedDependentResourceContext().getWorkflowReconcileResult(); + if (wrs.allDependentResourcesReady()) { - final var url = IngressDependent.getExposedURL( - context.getSecondaryResource(Ingress.class).orElseThrow()); - exposedApp.setStatus(new ExposedAppStatus(url, exposedApp.getSpec().getEndpoint())); - log.info("App {} is exposed and ready to be used at {}", name, exposedApp.getStatus().getHost()); - return UpdateControl.updateStatus(exposedApp); - } else { - final var duration = Duration.ofSeconds(1); - log.info("App {} is not ready yet, rescheduling reconciliation after {}s", name, duration.toSeconds()); - return UpdateControl. noUpdate().rescheduleAfter(duration); - } - }).orElseThrow(); + final var url = IngressDependent.getExposedURL( + context.getSecondaryResource(Ingress.class).orElseThrow()); + exposedApp.setStatus(new ExposedAppStatus(url, exposedApp.getSpec().getEndpoint())); + log.info("App {} is exposed and ready to be used at {}", name, exposedApp.getStatus().getHost()); + return UpdateControl.updateStatus(exposedApp); + } else { + final var duration = Duration.ofSeconds(1); + log.info("App {} is not ready yet, rescheduling reconciliation after {}s", name, duration.toSeconds()); + return UpdateControl. noUpdate().rescheduleAfter(duration); + } } static ObjectMeta createMetadata(ExposedApp resource, Map labels) {