Fix summary evaluation.

This commit is contained in:
Michael Lipp 2024-11-17 13:20:20 +01:00
parent dec4c11785
commit e7da41f838

View file

@ -329,7 +329,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
.map(r -> Quantity.fromString(r).getNumber().toBigInteger()) .map(r -> Quantity.fromString(r).getNumber().toBigInteger())
.orElse(BigInteger.ZERO)); .orElse(BigInteger.ZERO));
summary.runningVms summary.runningVms
= vmDef.<List<Map<String, Object>>> fromStatus("conditions") += vmDef.<List<Map<String, Object>>> fromStatus("conditions")
.orElse(Collections.emptyList()).stream() .orElse(Collections.emptyList()).stream()
.filter(cond -> DataPath.get(cond, "type") .filter(cond -> DataPath.get(cond, "type")
.map(t -> "Running".equals(t)).orElse(false) .map(t -> "Running".equals(t)).orElse(false)