From eafde7e64b320367ee952cd06cc8ca9dc127d144 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Mon, 20 Feb 2023 13:36:32 +0100 Subject: Wipe less --- .../java/com/yahoo/vespa/hosted/provision/applications/Cluster.java | 2 +- .../java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'node-repository') diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java index ea4944c2bd5..ea35f1e85ff 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java @@ -57,7 +57,7 @@ public class Cluster { this.suggested = Objects.requireNonNull(suggested); Objects.requireNonNull(target); if (target.resources().isPresent() && ! target.resources().get().isWithin(minResources, maxResources)) - this.target = Autoscaling.empty(); + this.target = target.withResources(Optional.empty()); // Delete illegal target else this.target = target; this.bcpGroupInfo = Objects.requireNonNull(bcpGroupInfo); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java index a68a667ffe6..3825309e97b 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java @@ -57,6 +57,10 @@ public class Autoscaling { return new Autoscaling(status, description, resources, at, peak, ideal, metrics); } + public Autoscaling withResources(Optional resources) { + return new Autoscaling(status, description, resources, at, peak, ideal, metrics); + } + /** Converts this autoscaling into an ideal one at the completion of it. */ public Autoscaling asIdeal(Instant at) { return new Autoscaling(Status.ideal, -- cgit v1.2.3