diff options
author | Harald Musum <musum@vespa.ai> | 2023-10-29 15:21:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 15:21:35 +0100 |
commit | e5f53beca8c5e69f4656c424f0ef1963b75ccd48 (patch) | |
tree | 728882ca55bc70818d989aa07dc26c66890a358a | |
parent | 8f58f2bd6aceba7442fb0c79734c09186e5bbeb6 (diff) | |
parent | ba350534b72287a73bff3b026cf41c32118f10ea (diff) |
Merge pull request #29142 from vespa-engine/hakonhall/default-cluster-capacity-count-to-1
-rw-r--r-- | flags/src/main/java/com/yahoo/vespa/flags/custom/ClusterCapacity.java | 4 |
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)); |