summaryrefslogtreecommitdiffstats
path: root/node-repository/src
diff options
context:
space:
mode:
authorOla Aunrønning <olaa@verizonmedia.com>2020-10-14 15:33:13 +0200
committerOla Aunrønning <olaa@verizonmedia.com>2020-10-14 15:44:10 +0200
commit48407588cbaeb2d670c43d825d98782ba27a2544 (patch)
tree2f3ec6c457b1753ff110220ee63d36a59b8c21c6 /node-repository/src
parent8039539c2717ef46c58060533eab5019d1b2a72e (diff)
Violation of parent host policy if reserved to different tenant
Diffstat (limited to 'node-repository/src')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/CapacityChecker.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/CapacityChecker.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/CapacityChecker.java
index bbd763eea45..e5202dfd3c0 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/CapacityChecker.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/CapacityChecker.java
@@ -275,6 +275,13 @@ public class CapacityChecker {
private static boolean violatesParentHostPolicy(Node node, Node host, Map<Node, List<Allocation>> containedAllocations) {
if (node.allocation().isEmpty()) return false;
Allocation nodeAllocation = node.allocation().get();
+
+ if (host.reservedTo()
+ .filter(tenantName -> !tenantName.equals(nodeAllocation.owner().tenant()))
+ .isPresent()) {
+ return true;
+ }
+
for (var allocation : containedAllocations.get(host)) {
if (allocation.membership().cluster().satisfies(nodeAllocation.membership().cluster())
&& allocation.owner().equals(nodeAllocation.owner())) {