summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java b/flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java
index 8ac83f2b2aa..4502bdf3f73 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java
@@ -35,7 +35,7 @@ public class ClusterCapacity {
private final String clusterType;
@JsonCreator
- public ClusterCapacity(@JsonProperty("count") int count,
+ public ClusterCapacity(@JsonProperty("count") Integer count,
@JsonProperty("vcpu") Double vcpu,
@JsonProperty("memoryGb") Double memoryGb,
@JsonProperty("diskGb") Double diskGb,
@@ -44,7 +44,7 @@ public class ClusterCapacity {
@JsonProperty("storageType") String storageType,
@JsonProperty("architecture") String architecture,
@JsonProperty("clusterType") String clusterType) {
- this.count = (int) requireNonNegative("count", count);
+ this.count = count == null ? 1 : (int) requireNonNegative("count", count);
this.vcpu = vcpu == null ? OptionalDouble.empty() : OptionalDouble.of(requireNonNegative("vcpu", vcpu));
this.memoryGb = memoryGb == null ? OptionalDouble.empty() : OptionalDouble.of(requireNonNegative("memoryGb", memoryGb));
this.diskGb = diskGb == null ? OptionalDouble.empty() : OptionalDouble.of(requireNonNegative("diskGb", diskGb));