Log when job cannot be resolved from deployment step
@@ -13,6 +13,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
+import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
@@ -87,7 +88,13 @@ public class DeploymentOrder {
return false;
}
DeploymentSpec.Step lastStep = deploymentSteps.get(deploymentSteps.size() - 1);
- return fromJob(job, application).map(s -> s.equals(lastStep)).orElse(false);
+ Optional<DeploymentSpec.Step> step = fromJob(job, application);
+ if (!step.isPresent()) {
+ log.log(Level.WARNING, "Could not find deployment step for " + application.id().toShortString() +
+ " from job " + job);
+ return false;
+ }
+ return step.get().equals(lastStep);
}
/** Returns jobs for given deployment spec, in the order they are declared */
