aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerij Fredriksen <freva@users.noreply.github.com>2023-02-20 13:54:23 +0100
committerGitHub <noreply@github.com>2023-02-20 13:54:23 +0100
commitafe64094b49a122e0133c876cb6afdf64a0662e9 (patch)
treefb4c999c4c357ed844647155cf36b43bbe700db5
parentea2aaf074611153783b0fbfd10659af39e3566a3 (diff)
parenteafde7e64b320367ee952cd06cc8ca9dc127d144 (diff)
Merge pull request #26112 from vespa-engine/bratseth/autoscaling-wipe-less
Wipe less
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java2
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaling.java4
2 files changed, 5 insertions, 1 deletions
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<ClusterResources> 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,