summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <jonbratseth@yahoo.com>2017-10-26 20:26:21 +0200
committerGitHub <noreply@github.com>2017-10-26 20:26:21 +0200
commita37e4edd39a8807da12219d68874fcc67bd934f0 (patch)
treecae0cdb8e50160650910cdbc40c1067de869c36c /node-repository
parent4a49a517a1aa9188ae74fccd7ab412a8e8125fa1 (diff)
parent201b8abb18420a31b9aaad592958487a40f8e583 (diff)
Merge pull request #3896 from vespa-engine/andreer/dont-let-out-of-spec-nodes-go-to-dirty
don't allow nodes with spec divergence to go to dirty
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java5
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java
index 92f52155edf..88daa34d8ca 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java
@@ -386,8 +386,9 @@ public class NodeRepository extends AbstractComponent {
Node nodeToDirty = getNode(hostname, Node.State.provisioned, Node.State.failed, Node.State.parked).orElseThrow(() ->
new IllegalArgumentException("Could not deallocate " + hostname + ": No such node in the provisioned, failed or parked state"));
- if (nodeToDirty.status().hardwareFailureDescription().isPresent())
- throw new IllegalArgumentException("Could not deallocate " + hostname + ": It has a hardware failure");
+ if (nodeToDirty.status().hardwareFailureDescription().isPresent() || nodeToDirty.status().hardwareDivergence().isPresent())
+ throw new IllegalArgumentException("Could not deallocate " + hostname + ": It has a hardware failure/spec divergence");
+
return setDirty(nodeToDirty);
}
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java
index f42ba220fdf..37b2f54da4d 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java
@@ -273,7 +273,7 @@ public class RestApiTest {
"{\"message\":\"Moved host12.yahoo.com to failed\"}");
assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/host12.yahoo.com",
new byte[0], Request.Method.PUT), 400,
- "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not deallocate host12.yahoo.com: It has a hardware failure\"}");
+ "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not deallocate host12.yahoo.com: It has a hardware failure/spec divergence\"}");
}
@Test