summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-02-05 09:37:52 +0100
committerGitHub <noreply@github.com>2021-02-05 09:37:52 +0100
commit5b995158b3e482fff0c8da4294185305fcf692a6 (patch)
treeb9e5ecb4dd1a487423aaf39a7fd127784c859c82 /config-model
parent507d50a8523f4e94ea4ed2cc9c5a2ff2b2adb7cd (diff)
Revert "Emit restart change actions for any resource change"
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidator.java2
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidatorTest.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidator.java
index a462cb4fdb3..0add9f243fe 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidator.java
@@ -39,7 +39,7 @@ public class NodeResourceChangeValidator implements ChangeValidator {
}
private boolean changeRequiresRestart(NodeResources currentResources, NodeResources nextResources) {
- return !currentResources.equals(nextResources);
+ return currentResources.memoryGb() != nextResources.memoryGb();
}
private Optional<NodeResources> resourcesOf(ClusterSpec.Id clusterId, VespaModel model) {
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidatorTest.java
index 180e4913d5c..ecf026e7d88 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/NodeResourceChangeValidatorTest.java
@@ -61,7 +61,7 @@ public class NodeResourceChangeValidatorTest {
Clock.systemUTC().instant());
}
- private static VespaModel model(int mem1, int mem2, int cpu1, int cpu2) {
+ private static VespaModel model(int mem1, int mem2, int mem3, int mem4) {
var properties = new TestProperties();
properties.setHostedVespa(true);
var deployState = new DeployState.Builder().properties(properties)
@@ -82,7 +82,7 @@ public class NodeResourceChangeValidatorTest {
" </container>\n" +
" <content id='content1' version='1.0'>\n" +
" <nodes count='3'>\n" +
- " <resources vcpu='" + cpu1 + "' memory='8Gb' disk='100Gb'/>" +
+ " <resources vcpu='1' memory='" + mem3 + "Gb' disk='100Gb'/>" +
" </nodes>\n" +
" <documents>\n" +
" <document mode='index' type='test'/>\n" +
@@ -91,7 +91,7 @@ public class NodeResourceChangeValidatorTest {
" </content>\n" +
" <content id='content2' version='1.0'>\n" +
" <nodes count='4'>\n" +
- " <resources vcpu='" + cpu2 + "' memory='8Gb' disk='100Gb'/>" +
+ " <resources vcpu='1' memory='" + mem4 + "Gb' disk='100Gb'/>" +
" </nodes>\n" +
" <documents>\n" +
" <document mode='streaming' type='test'/>\n" +