diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2022-11-07 15:16:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 15:16:13 +0100 |
commit | b8d794ecd9d2407bcb2e2c8e79e2332edcd82500 (patch) | |
tree | 76f7ed51d84473ed215e77b93671139b43d5695d | |
parent | adc1c1fa16945d9f29778706f5bf8161434c2361 (diff) |
Revert "Set cloud account on child nodes as well"
4 files changed, 4 insertions, 19 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java index de1f9e65415..768036fd284 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java @@ -118,6 +118,7 @@ public final class Node implements Nodelike { if (!ipConfig.pool().ipSet().isEmpty()) throw new IllegalArgumentException("A child node cannot have an IP address pool"); if (modelName.isPresent()) throw new IllegalArgumentException("A child node cannot have model name set"); if (switchHostname.isPresent()) throw new IllegalArgumentException("A child node cannot have switch hostname set"); + if (!cloudAccount.isEmpty()) throw new IllegalArgumentException("A child node cannot have cloud account set"); } if (type != NodeType.host && reservedTo.isPresent()) diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java index c2a6e4658f3..7947fe9f021 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java @@ -3,7 +3,6 @@ package com.yahoo.vespa.hosted.provision.provisioning; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ApplicationTransaction; -import com.yahoo.config.provision.CloudAccount; import com.yahoo.config.provision.ClusterMembership; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Flavor; @@ -89,8 +88,7 @@ class Activator { NodeList activeToRemove = oldActive.matching(node -> ! hostnames.contains(node.hostname())); remove(activeToRemove, transaction); // TODO: Pass activation time in this call and next line - // TODO (freva): Replace .mapToList(...) with .asList() after 8.80 - nodeRepository.nodes().activate(newActive.mapToList(node -> fixCloudAccount(node, allNodes)), transaction.nested()); // activate also continued active to update node state + nodeRepository.nodes().activate(newActive.asList(), transaction.nested()); // activate also continued active to update node state rememberResourceChange(transaction, generation, activationTime, oldActive.not().retired(), @@ -250,14 +248,4 @@ class Activator { return null; } - private Node fixCloudAccount(Node node, NodeList allNodes) { - // Existing nodes do not have cloudAccount set, copy the one from parent - CloudAccount cloudAccount = allNodes.parentOf(node).map(Node::cloudAccount).orElseGet(node::cloudAccount); - return new Node(node.id(), node.ipConfig(), node.hostname(), - node.parentHostname(), node.flavor(), node.status(), node.state(), node.allocation(), node.history(), - node.type(), node.reports(), node.modelName(), node.reservedTo(), - node.exclusiveToApplicationId(), node.exclusiveToClusterType(), node.switchHostname(), - node.trustedCertificates(), cloudAccount); - } - } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java index b1b230479ee..8e13ac65c21 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java @@ -430,9 +430,7 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat resources.with(parent.get().resources().diskSpeed()) .with(parent.get().resources().storageType()) .with(parent.get().resources().architecture()), - NodeType.tenant) - .cloudAccount(parent.get().cloudAccount()) - .build(); + NodeType.tenant).build(); return new ConcreteNodeCandidate(node, freeParentCapacity, parent, violatesSpares, exclusiveSwitch, isSurplus, isNew, isResizable); } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java index 15a6b6ba523..35b80459168 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java @@ -74,9 +74,7 @@ public class ProvisionedHost { /** Generate {@link Node} instance representing the node running on this physical host */ public Node generateNode() { - return Node.reserve(Set.of(), nodeHostname(), hostHostname, nodeResources, hostType.childNodeType()) - .cloudAccount(cloudAccount) - .build(); + return Node.reserve(Set.of(), nodeHostname(), hostHostname, nodeResources, hostType.childNodeType()).build(); } public String getId() { return id; } |