diff options
Diffstat (limited to 'node-repository')
49 files changed, 410 insertions, 283 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 ce6ec8fd7fe..f93354333a1 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 @@ -1,7 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.provision; -import com.google.common.collect.ImmutableSet; import com.google.inject.Inject; import com.yahoo.collections.ListMap; import com.yahoo.component.AbstractComponent; @@ -22,6 +21,7 @@ import com.yahoo.vespa.hosted.provision.maintenance.InfrastructureVersions; import com.yahoo.vespa.hosted.provision.maintenance.JobControl; import com.yahoo.vespa.hosted.provision.maintenance.PeriodicApplicationMaintainer; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.IP; import com.yahoo.vespa.hosted.provision.node.NodeAcl; import com.yahoo.vespa.hosted.provision.node.filter.NodeFilter; import com.yahoo.vespa.hosted.provision.node.filter.NodeListFilter; @@ -298,23 +298,17 @@ public class NodeRepository extends AbstractComponent { // ----------------- Node lifecycle ----------------------------------------------------------- /** Creates a new node object, without adding it to the node repo. If no IP address is given, it will be resolved */ - public Node createNode(String openStackId, String hostname, Set<String> ipAddresses, Set<String> ipAddressPool, Optional<String> parentHostname, + public Node createNode(String openStackId, String hostname, IP.Config ipConfig, Optional<String> parentHostname, Optional<String> modelName, Flavor flavor, NodeType type) { - if (ipAddresses.isEmpty()) { - ipAddresses = nameResolver.getAllByNameOrThrow(hostname); + if (ipConfig.primary().isEmpty()) { // TODO: Remove this. Only test code hits this path + ipConfig = ipConfig.with(nameResolver.getAllByNameOrThrow(hostname)); } - - return Node.create(openStackId, ImmutableSet.copyOf(ipAddresses), ipAddressPool, hostname, parentHostname, modelName, flavor, type); - } - - public Node createNode(String openStackId, String hostname, Set<String> ipAddresses, Optional<String> parentHostname, - Flavor flavor, NodeType type) { - return createNode(openStackId, hostname, ipAddresses, Collections.emptySet(), parentHostname, Optional.empty(), flavor, type); + return Node.create(openStackId, ipConfig.primary(), ipConfig.pool().asSet(), hostname, parentHostname, modelName, flavor, type); } - public Node createNode(String openStackId, String hostname, Optional<String> parentHostname, - Flavor flavor, NodeType type) { - return createNode(openStackId, hostname, Collections.emptySet(), parentHostname, flavor, type); + public Node createNode(String openStackId, String hostname, Optional<String> parentHostname, Flavor flavor, + NodeType type) { + return createNode(openStackId, hostname, IP.Config.EMPTY, parentHostname, Optional.empty(), flavor, type); } /** Adds a list of newly created docker container nodes to the node repository as <i>reserved</i> nodes */ @@ -351,7 +345,7 @@ public class NodeRepository extends AbstractComponent { if (node.equals(other)) throw new IllegalArgumentException(message); } } - return db.addNodesInState(nodes, Node.State.provisioned); + return db.addNodesInState(IP.Config.verify(nodes, list(lock)), Node.State.provisioned); } } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/IP.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/IP.java index 544c3743d01..424d12740cb 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/IP.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/IP.java @@ -5,12 +5,14 @@ import com.google.common.collect.ImmutableSet; import com.google.common.net.InetAddresses; import com.google.common.primitives.UnsignedBytes; import com.yahoo.vespa.hosted.provision.LockedNodeList; +import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.persistence.NameResolver; import java.net.Inet4Address; import java.net.Inet6Address; import java.util.Collections; import java.util.Comparator; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; @@ -113,6 +115,35 @@ public class IP { return addresses; } + /** + * Verify IP config of given nodes + * + * @throws IllegalArgumentException if there are IP conflicts with existing nodes + */ + public static List<Node> verify(List<Node> nodes, LockedNodeList allNodes) { + for (Node node : nodes) { + for (Node other : allNodes) { + if (node.equals(other)) continue; + Set<String> addresses = new HashSet<>(node.ipConfig().primary()); + Set<String> otherAddresses = new HashSet<>(other.ipConfig().primary()); + if (node.type().isDockerHost()) { // Addresses of a host can never overlap with any other nodes + addresses.addAll(node.ipConfig().pool().asSet()); + otherAddresses.addAll(other.ipConfig().pool().asSet()); + } + otherAddresses.retainAll(addresses); + if (!otherAddresses.isEmpty()) + throw new IllegalArgumentException("Cannot assign " + addresses + " to " + node.hostname() + + ": " + otherAddresses + " already assigned to " + + other.hostname()); + } + } + return nodes; + } + + public static Node verify(Node node, LockedNodeList allNodes) { + return verify(List.of(node), allNodes).get(0); + } + } /** A pool of IP addresses. Addresses in this are destined for use by Docker containers */ diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java index 2d9d22794cf..5a2e57c49c2 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java @@ -10,8 +10,8 @@ import com.yahoo.slime.Inspector; import com.yahoo.slime.ObjectTraverser; import com.yahoo.slime.Type; import com.yahoo.vespa.config.SlimeUtils; +import com.yahoo.vespa.hosted.provision.LockedNodeList; import com.yahoo.vespa.hosted.provision.Node; -import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Agent; import com.yahoo.vespa.hosted.provision.node.Allocation; import com.yahoo.vespa.hosted.provision.node.IP; @@ -20,9 +20,10 @@ import com.yahoo.vespa.hosted.provision.node.Reports; import java.io.IOException; import java.io.InputStream; +import java.io.UncheckedIOException; +import java.time.Clock; import java.time.Instant; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; @@ -43,24 +44,23 @@ public class NodePatcher { private final NodeFlavors nodeFlavors; private final Inspector inspector; - private final NodeRepository nodeRepository; + private final LockedNodeList nodes; + private final Clock clock; private Node node; private List<Node> children; private boolean childrenModified = false; - public NodePatcher(NodeFlavors nodeFlavors, InputStream json, Node node, NodeRepository nodeRepository) { + public NodePatcher(NodeFlavors nodeFlavors, InputStream json, Node node, LockedNodeList nodes, Clock clock) { + this.nodeFlavors = nodeFlavors; + this.node = node; + this.children = node.type().isDockerHost() ? nodes.childrenOf(node).asList() : List.of(); + this.nodes = nodes; + this.clock = clock; try { - this.nodeFlavors = nodeFlavors; - inspector = SlimeUtils.jsonToSlime(IOUtils.readBytes(json, 1000 * 1000)).get(); - this.node = node; - this.nodeRepository = nodeRepository; - this.children = node.type().isDockerHost() ? - nodeRepository.list().childrenOf(node).asList() : - Collections.emptyList(); - } - catch (IOException e) { - throw new RuntimeException("Error reading request body", e); + this.inspector = SlimeUtils.jsonToSlime(IOUtils.readBytes(json, 1000 * 1000)).get(); + } catch (IOException e) { + throw new UncheckedIOException("Error reading request body", e); } } @@ -108,7 +108,7 @@ public class NodePatcher { private Node applyField(Node node, String name, Inspector value) { switch (name) { case "currentRebootGeneration" : - return node.withCurrentRebootGeneration(asLong(value), nodeRepository.clock().instant()); + return node.withCurrentRebootGeneration(asLong(value), clock.instant()); case "currentRestartGeneration" : return patchCurrentRestartGeneration(asLong(value)); case "currentDockerImage" : @@ -131,11 +131,11 @@ public class NodePatcher { case "parentHostname" : return node.withParentHostname(asString(value)); case "ipAddresses" : - return node.with(node.ipConfig().with(asStringSet(value))); + return IP.Config.verify(node.with(node.ipConfig().with(asStringSet(value))), nodes); case "additionalIpAddresses" : - return node.with(node.ipConfig().with(IP.Pool.of(asStringSet(value)))); + return IP.Config.verify(node.with(node.ipConfig().with(IP.Pool.of(asStringSet(value)))), nodes); case WANT_TO_RETIRE : - return node.withWantToRetire(asBoolean(value), Agent.operator, nodeRepository.clock().instant()); + return node.withWantToRetire(asBoolean(value), Agent.operator, clock.instant()); case WANT_TO_DEPROVISION : return node.with(node.status().withWantToDeprovision(asBoolean(value))); case "hardwareDivergence" : diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesApiHandler.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesApiHandler.java index 74e4bd7b4d2..22318f1ddb4 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesApiHandler.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesApiHandler.java @@ -19,6 +19,7 @@ import com.yahoo.vespa.hosted.provision.NoSuchNodeException; import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.IP; import com.yahoo.vespa.hosted.provision.node.filter.ApplicationFilter; import com.yahoo.vespa.hosted.provision.node.filter.NodeFilter; import com.yahoo.vespa.hosted.provision.node.filter.NodeHostFilter; @@ -137,7 +138,9 @@ public class NodesApiHandler extends LoggingRequestHandler { if (path.startsWith("/nodes/v2/node/")) { Node node = nodeFromRequest(request); try (var lock = nodeRepository.lock(node)) { - nodeRepository.write(new NodePatcher(nodeFlavors, request.getData(), node, nodeRepository).apply(), lock); + var patchedNode = new NodePatcher(nodeFlavors, request.getData(), node, nodeRepository.list(lock), + nodeRepository.clock()).apply(); + nodeRepository.write(patchedNode, lock); } return new MessageResponse("Updated " + node.hostname()); } @@ -218,8 +221,7 @@ public class NodesApiHandler extends LoggingRequestHandler { return nodeRepository.createNode( inspector.field("openStackId").asString(), inspector.field("hostname").asString(), - ipAddresses, - ipAddressPool, + new IP.Config(ipAddresses, ipAddressPool), parentHostname, modelName, nodeFlavors.getFlavorOrThrow(inspector.field("flavor").asString()), diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java index 9fccdfda9fe..eb59d9e7e8e 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java @@ -1,7 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.provision.testutils; -import com.google.common.collect.ImmutableSet; import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ApplicationName; @@ -9,10 +8,10 @@ import com.yahoo.config.provision.Capacity; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Flavor; -import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.RotationName; import com.yahoo.config.provision.TenantName; @@ -23,6 +22,7 @@ import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.IP; import com.yahoo.vespa.hosted.provision.node.Status; import com.yahoo.vespa.hosted.provision.provisioning.NodeRepositoryProvisioner; @@ -31,6 +31,7 @@ import java.time.Instant; import java.time.ZoneId; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashSet; import java.util.List; import java.util.Optional; import java.util.Set; @@ -49,9 +50,7 @@ public class MockNodeRepository extends NodeRepository { */ public MockNodeRepository(MockCurator curator, NodeFlavors flavors) { super(flavors, curator, Clock.fixed(Instant.ofEpochMilli(123), ZoneId.of("Z")), Zone.defaultZone(), - new MockNameResolver() - .addRecord("test-container-1", "::2") - .mockAnyLookup(), + new MockNameResolver().mockAnyLookup(), DockerImage.fromString("docker-registry.domain.tld:8080/dist/vespa"), true); this.flavors = flavors; @@ -69,38 +68,34 @@ public class MockNodeRepository extends NodeRepository { List<Node> nodes = new ArrayList<>(); // Regular nodes - Set<String> ipAddresses = ImmutableSet.of("::1", "127.0.0.1"); - Set<String> ipAddressPool = ImmutableSet.of("::2", "::3", "::4"); - - nodes.add(createNode("node1", "host1.yahoo.com", ipAddresses, Optional.empty(), + nodes.add(createNode("node1", "host1.yahoo.com", ipConfig(1), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant)); - nodes.add(createNode("node2", "host2.yahoo.com", ipAddresses, Optional.empty(), + nodes.add(createNode("node2", "host2.yahoo.com", ipConfig(2), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant)); - nodes.add(createNode("node3", "host3.yahoo.com", ipAddresses, Optional.empty(), + nodes.add(createNode("node3", "host3.yahoo.com", ipConfig(3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("expensive"), NodeType.tenant)); - - Node node4 = createNode("node4", "host4.yahoo.com", ipAddresses, Optional.of("dockerhost1.yahoo.com"), + Node node4 = createNode("node4", "host4.yahoo.com", ipConfig(4), Optional.of("dockerhost1.yahoo.com"), Optional.empty(), new Flavor(new NodeResources(1, 1, 100)), NodeType.tenant); node4 = node4.with(node4.status() - .withVespaVersion(new Version("6.41.0")) - .withDockerImage(DockerImage.fromString("docker-registry.domain.tld:8080/dist/vespa:6.41.0"))); + .withVespaVersion(new Version("6.41.0")) + .withDockerImage(DockerImage.fromString("docker-registry.domain.tld:8080/dist/vespa:6.41.0"))); nodes.add(node4); - Node node5 = createNode("node5", "host5.yahoo.com", ipAddresses, Optional.of("dockerhost2.yahoo.com"), + Node node5 = createNode("node5", "host5.yahoo.com", ipConfig(5), Optional.of("dockerhost2.yahoo.com"), Optional.empty(), new Flavor(new NodeResources(1, 1, 100)), NodeType.tenant); nodes.add(node5.with(node5.status() - .withVespaVersion(new Version("1.2.3")) - .withDockerImage(DockerImage.fromString("docker-registry.domain.tld:8080/dist/vespa:1.2.3")))); + .withVespaVersion(new Version("1.2.3")) + .withDockerImage(DockerImage.fromString("docker-registry.domain.tld:8080/dist/vespa:1.2.3")))); - nodes.add(createNode("node6", "host6.yahoo.com", ipAddresses, Optional.empty(), + nodes.add(createNode("node6", "host6.yahoo.com", ipConfig(6), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant)); - Node node7 = createNode("node7", "host7.yahoo.com", ipAddresses, Optional.empty(), + Node node7 = createNode("node7", "host7.yahoo.com", ipConfig(7), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant); nodes.add(node7); // 8, 9, 11 and 12 are added by web service calls - Node node10 = createNode("node10", "host10.yahoo.com", ipAddresses, Optional.of("parent1.yahoo.com"), + Node node10 = createNode("node10", "host10.yahoo.com", ipConfig(10), Optional.of("parent1.yahoo.com"), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant); Status node10newStatus = node10.status(); node10newStatus = node10newStatus @@ -109,33 +104,33 @@ public class MockNodeRepository extends NodeRepository { node10 = node10.with(node10newStatus); nodes.add(node10); - Node node13 = createNode("node13", "host13.yahoo.com", ipAddresses, Optional.empty(), + Node node13 = createNode("node13", "host13.yahoo.com", ipConfig(13), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.tenant); - Node node14 = createNode("node14", "host14.yahoo.com", ipAddresses, Optional.empty(), + Node node14 = createNode("node14", "host14.yahoo.com", ipConfig(14), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.tenant); nodes.add(node13); nodes.add(node14); - Node node55 = createNode("node55", "host55.yahoo.com", ipAddresses, Optional.empty(), + Node node55 = createNode("node55", "host55.yahoo.com", ipConfig(55), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant); nodes.add(node55.with(node55.status().withWantToRetire(true).withWantToDeprovision(true))); /* Setup docker hosts (two of these will be reserved for spares */ - nodes.add(createNode("dockerhost1", "dockerhost1.yahoo.com", ipAddresses, ipAddressPool, Optional.empty(), Optional.empty(), + nodes.add(createNode("dockerhost1", "dockerhost1.yahoo.com", ipConfig(100, 1, 3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.host)); - nodes.add(createNode("dockerhost2", "dockerhost2.yahoo.com", ipAddresses, ipAddressPool, Optional.empty(), Optional.empty(), + nodes.add(createNode("dockerhost2", "dockerhost2.yahoo.com", ipConfig(101, 1, 3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.host)); - nodes.add(createNode("dockerhost3", "dockerhost3.yahoo.com", ipAddresses, ipAddressPool, Optional.empty(), Optional.empty(), + nodes.add(createNode("dockerhost3", "dockerhost3.yahoo.com", ipConfig(102, 1, 3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.host)); - nodes.add(createNode("dockerhost4", "dockerhost4.yahoo.com", ipAddresses, ipAddressPool, Optional.empty(), Optional.empty(), + nodes.add(createNode("dockerhost4", "dockerhost4.yahoo.com", ipConfig(103, 1, 3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.host)); - nodes.add(createNode("dockerhost5", "dockerhost5.yahoo.com", ipAddresses, ipAddressPool, Optional.empty(), Optional.empty(), + nodes.add(createNode("dockerhost5", "dockerhost5.yahoo.com", ipConfig(104, 1, 3), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("large"), NodeType.host)); // Config servers - nodes.add(createNode("cfg1", "cfg1.yahoo.com", Collections.singleton("127.0.1.1"), Optional.empty(), + nodes.add(createNode("cfg1", "cfg1.yahoo.com", ipConfig(201), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.config)); - nodes.add(createNode("cfg2", "cfg2.yahoo.com", Collections.singleton("127.0.1.2"), Optional.empty(), + nodes.add(createNode("cfg2", "cfg2.yahoo.com", ipConfig(202), Optional.empty(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.config)); // Ready all nodes, except 7 and 55 @@ -190,4 +185,40 @@ public class MockNodeRepository extends NodeRepository { provisioner.activate(transaction, application, hosts); transaction.commit(); } + + private void addRecord(String name, String ipAddress) { + var nameResolver = (MockNameResolver) nameResolver(); + nameResolver.addRecord(name, ipAddress); + nameResolver.addReverseRecord(ipAddress, name); + } + + private IP.Config ipConfig(int nodeIndex, int primarySize, int poolSize) { + var primary = new LinkedHashSet<String>(); + var pool = new LinkedHashSet<String>(); + for (int i = 1; i <= primarySize + poolSize; i++) { + var set = primary; + if (i > primarySize) { + set = pool; + } + var rootName = "test-node-primary"; + if (i > primarySize) { + rootName = "test-node-pool"; + } + var name = rootName + "-" + nodeIndex + "-" + i; + var ipv6Address = "::" + nodeIndex + ":" + i; + addRecord(name, ipv6Address); + set.add(ipv6Address); + if (i <= primarySize) { + var ipv4Address = "127.0." + nodeIndex + "." + i; + addRecord(name, ipv4Address); + set.add(ipv4Address); + } + } + return new IP.Config(primary, pool); + } + + private IP.Config ipConfig(int nodeIndex) { + return ipConfig(nodeIndex, 1, 0); + } + } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRetirerTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRetirerTester.java index 0afe279171e..832c2fc512b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRetirerTester.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRetirerTester.java @@ -20,6 +20,7 @@ import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.maintenance.retire.RetirementPolicy; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.IP; import com.yahoo.vespa.hosted.provision.provisioning.FlavorConfigBuilder; import com.yahoo.vespa.hosted.provision.provisioning.FlavorSpareChecker; import com.yahoo.vespa.hosted.provision.provisioning.NodeRepositoryProvisioner; @@ -40,6 +41,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.LongStream; @@ -97,7 +99,8 @@ public class NodeRetirerTester { for (int j = 0; j < nums[i]; j++) { int id = nextNodeId++; nodes.add(nodeRepository.createNode("node" + id, "host" + id + ".test.yahoo.com", - Collections.singleton("::1"), Optional.empty(), flavor, NodeType.tenant)); + new IP.Config(Set.of("::1"), Set.of()), Optional.empty(), + Optional.empty(), flavor, NodeType.tenant)); } } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicDockerAllocationTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicDockerAllocationTest.java index 2761bcb821a..a48006facb2 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicDockerAllocationTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicDockerAllocationTest.java @@ -9,8 +9,8 @@ import com.yahoo.config.provision.ClusterMembership; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.Flavor; -import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.HostSpec; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.OutOfCapacityException; import com.yahoo.config.provision.RegionName; @@ -77,8 +77,8 @@ public class DynamicDockerAllocationTest { // Application 2 ApplicationId application2 = makeApplicationId("t2", "a2"); ClusterSpec clusterSpec2 = clusterSpec("myContent.t2.a2"); - addAndAssignNode(application2, "2a", dockerHosts.get(2).hostname(), clusterSpec2, flavor, 0, tester); - addAndAssignNode(application2, "2b", dockerHosts.get(3).hostname(), clusterSpec2, flavor, 1, tester); + addAndAssignNode(application2, "2a", dockerHosts.get(2).hostname(), clusterSpec2, flavor, 3, tester); + addAndAssignNode(application2, "2b", dockerHosts.get(3).hostname(), clusterSpec2, flavor, 4, tester); // Redeploy both applications (to be agnostic on which hosts are picked as spares) deployApp(application1, clusterSpec1, flavor, tester, 2); @@ -289,7 +289,7 @@ public class DynamicDockerAllocationTest { } private void addAndAssignNode(ApplicationId id, String hostname, String parentHostname, ClusterSpec clusterSpec, NodeResources flavor, int index, ProvisioningTester tester) { - Node node1a = Node.create("open1", Collections.singleton("127.0.0.100"), new HashSet<>(), hostname, Optional.of(parentHostname), Optional.empty(), new Flavor(flavor), NodeType.tenant); + Node node1a = Node.create("open1", Set.of("127.0.233." + index), Set.of(), hostname, Optional.of(parentHostname), Optional.empty(), new Flavor(flavor), NodeType.tenant); ClusterMembership clusterMembership1 = ClusterMembership.from( clusterSpec.with(Optional.of(ClusterSpec.Group.from(0))), index); // Need to add group here so that group is serialized in node allocation Node node1aAllocation = node1a.allocate(id, clusterMembership1, Instant.now()); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java index f13dd56b262..7e4cb4e4a6a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java @@ -8,11 +8,11 @@ import com.yahoo.config.provision.Capacity; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Flavor; -import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.HostFilter; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.ProvisionLogger; import com.yahoo.config.provision.TenantName; @@ -30,6 +30,7 @@ import com.yahoo.vespa.hosted.provision.NodeList; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.lb.LoadBalancerServiceMock; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.IP; import com.yahoo.vespa.hosted.provision.node.filter.NodeHostFilter; import com.yahoo.vespa.hosted.provision.persistence.NameResolver; import com.yahoo.vespa.hosted.provision.testutils.MockNameResolver; @@ -41,7 +42,6 @@ import com.yahoo.vespa.service.duper.ConfigServerApplication; import java.time.temporal.TemporalAmount; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; @@ -282,8 +282,7 @@ public class ProvisioningTester { nodes.add(nodeRepository.createNode(hostname, hostname, - hostIps, - ipAddressPool, + new IP.Config(hostIps, ipAddressPool), Optional.empty(), Optional.empty(), flavor.get(), @@ -304,7 +303,8 @@ public class ProvisioningTester { nameResolver.addRecord(hostname, ipv4); Node node = nodeRepository.createNode(hostname, hostname, - Collections.singleton(ipv4), + new IP.Config(Set.of(ipv4), Set.of()), + Optional.empty(), Optional.empty(), nodeFlavors.getFlavorOrThrow(flavor), NodeType.config); 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 80d8ffb7c60..de315957df9 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 @@ -103,9 +103,9 @@ public class RestApiTest { // POST new nodes assertResponse(new Request("http://localhost:8080/nodes/v2/node", - ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.0.1") + "," + // test with only 1 ip address - asNodeJson("host9.yahoo.com", "large-variant", "127.0.0.1", "::1") + "," + - asHostJson("parent2.yahoo.com", "large-variant", "127.0.0.1", "::1") + "," + + ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.8.1") + "," + // test with only 1 ip address + asNodeJson("host9.yahoo.com", "large-variant", "127.0.9.1", "::9:1") + "," + + asHostJson("parent2.yahoo.com", "large-variant", "127.0.127.1", "::127:1") + "," + asDockerNodeJson("host11.yahoo.com", "parent.host.yahoo.com", "::11") + "]"). getBytes(StandardCharsets.UTF_8), Request.Method.POST), @@ -117,7 +117,7 @@ public class RestApiTest { // POST duplicate node assertResponse(new Request("http://localhost:8080/nodes/v2/node", - ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.0.1") + "]").getBytes(StandardCharsets.UTF_8), + ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.254.8") + "]").getBytes(StandardCharsets.UTF_8), Request.Method.POST), 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot add host8.yahoo.com: A node with this name already exists\"}"); @@ -163,23 +163,23 @@ public class RestApiTest { "{\"message\":\"Removed host8.yahoo.com\"}"); // or, PUT a node in failed ... - assertResponse(new Request("http://localhost:8080/nodes/v2/state/failed/test-container-1", + assertResponse(new Request("http://localhost:8080/nodes/v2/state/failed/test-node-pool-101-2", new byte[0], Request.Method.PUT), - "{\"message\":\"Moved test-container-1 to failed\"}"); - assertResponseContains(new Request("http://localhost:8080/nodes/v2/node/test-container-1"), + "{\"message\":\"Moved test-node-pool-101-2 to failed\"}"); + assertResponseContains(new Request("http://localhost:8080/nodes/v2/node/test-node-pool-101-2"), "\"state\":\"failed\""); // ... and deallocate it such that it moves to dirty and is recycled - assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/test-container-1", + assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/test-node-pool-101-2", new byte[0], Request.Method.PUT), - "{\"message\":\"Moved test-container-1 to dirty\"}"); + "{\"message\":\"Moved test-node-pool-101-2 to dirty\"}"); // ... and set it back to ready as if this was from the node-admin with the temporary state rest api - assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/test-container-1", + assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/test-node-pool-101-2", new byte[0], Request.Method.PUT), - "{\"message\":\"Moved test-container-1 to ready\"}"); + "{\"message\":\"Moved test-node-pool-101-2 to ready\"}"); - assertResponse(new Request("http://localhost:8080/nodes/v2/node/test-container-1", new byte[0], Request.Method.GET), - 404, "{\"error-code\":\"NOT_FOUND\",\"message\":\"No node with hostname 'test-container-1'\"}"); + assertResponse(new Request("http://localhost:8080/nodes/v2/node/test-node-pool-101-2", new byte[0], Request.Method.GET), + 404, "{\"error-code\":\"NOT_FOUND\",\"message\":\"No node with hostname 'test-node-pool-101-2'\"}"); // Put a host in failed and make sure it's children are also failed assertResponse(new Request("http://localhost:8080/nodes/v2/state/failed/dockerhost1.yahoo.com", new byte[0], Request.Method.PUT), @@ -258,7 +258,7 @@ public class RestApiTest { Request.Method.POST), "{\"message\":\"Added 1 nodes to the provisioned state\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/node", - ("[" + asNodeJson("dual-stack-host.yahoo.com", "default", "127.0.0.1", "::1") + "]"). + ("[" + asNodeJson("dual-stack-host.yahoo.com", "default", "127.0.254.254", "::254:254") + "]"). getBytes(StandardCharsets.UTF_8), Request.Method.POST), "{\"message\":\"Added 1 nodes to the provisioned state\"}"); @@ -271,6 +271,30 @@ public class RestApiTest { getBytes(StandardCharsets.UTF_8), Request.Method.POST); assertResponse(req, 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Found one or more invalid addresses in [foo]: 'foo' is not an IP string literal.\"}"); + + // Attempt to POST tenant node with already assigned IP + assertResponse(new Request("http://localhost:8080/nodes/v2/node", + "[" + asNodeJson("tenant-node-foo.yahoo.com", "default", "127.0.1.1") + "]", + Request.Method.POST), 400, + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot assign [127.0.1.1] to tenant-node-foo.yahoo.com: [127.0.1.1] already assigned to host1.yahoo.com\"}"); + + // Attempt to PATCH existing tenant node with already assigned IP + assertResponse(new Request("http://localhost:8080/nodes/v2/node/test-node-pool-101-2", + "{\"ipAddresses\": [\"127.0.2.1\"]}", + Request.Method.PATCH), 400, + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set field 'ipAddresses': Cannot assign [127.0.2.1] to test-node-pool-101-2: [127.0.2.1] already assigned to host2.yahoo.com\"}"); + + // Attempt to POST host node with already assigned IP + assertResponse(new Request("http://localhost:8080/nodes/v2/node", + "[" + asHostJson("host200.yahoo.com", "default", "127.0.2.1") + "]", + Request.Method.POST), 400, + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot assign [127.0.2.1] to host200.yahoo.com: [127.0.2.1] already assigned to host2.yahoo.com\"}"); + + // Attempt to PATCH host node with IP in the pool of another node + assertResponse(new Request("http://localhost:8080/nodes/v2/node/dockerhost1.yahoo.com", + "{\"ipAddresses\": [\"::104:3\"]}", + Request.Method.PATCH), 400, + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set field 'ipAddresses': Cannot assign [::100:4, ::100:3, ::100:2, ::104:3] to dockerhost1.yahoo.com: [::104:3] already assigned to dockerhost5.yahoo.com\"}"); } @Test @@ -340,8 +364,7 @@ public class RestApiTest { public void acl_request_by_tenant_node() throws Exception { String hostname = "foo.yahoo.com"; assertResponse(new Request("http://localhost:8080/nodes/v2/node", - ("[" + asNodeJson(hostname, "default") + "]"). - getBytes(StandardCharsets.UTF_8), + ("[" + asNodeJson(hostname, "default", "127.0.222.1") + "]").getBytes(StandardCharsets.UTF_8), Request.Method.POST), "{\"message\":\"Added 1 nodes to the provisioned state\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/" + hostname, @@ -433,8 +456,8 @@ public class RestApiTest { // Attempt to POST duplicate nodes assertResponse(new Request("http://localhost:8080/nodes/v2/node", - ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.0.1", "::1") + "," + - asNodeJson("host8.yahoo.com", "large-variant", "127.0.0.1", "::1") + "]").getBytes(StandardCharsets.UTF_8), + ("[" + asNodeJson("host8.yahoo.com", "default", "127.0.254.1", "::254:1") + "," + + asNodeJson("host8.yahoo.com", "large-variant", "127.0.253.1", "::253:1") + "]").getBytes(StandardCharsets.UTF_8), Request.Method.POST), 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot add host8.yahoo.com: A node with this name already exists\"}"); } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-config-server.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-config-server.json index 05fa3e8ad72..e489aec2df6 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-config-server.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-config-server.json @@ -3,211 +3,223 @@ { "hostname": "cfg1.yahoo.com", "type": "config", - "ipAddress": "127.0.1.1", + "ipAddress": "127.0.201.1", + "trustedBy": "cfg1.yahoo.com" + }, + { + "hostname": "cfg1.yahoo.com", + "type": "config", + "ipAddress": "::201:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "cfg2.yahoo.com", "type": "config", - "ipAddress": "127.0.1.2", + "ipAddress": "127.0.202.1", + "trustedBy": "cfg1.yahoo.com" + }, + { + "hostname": "cfg2.yahoo.com", + "type": "config", + "ipAddress": "::202:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost1.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.100.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost1.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::100:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost2.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.101.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost2.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::101:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost3.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.102.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost3.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::102:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost4.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.103.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost4.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::103:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost5.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.104.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "dockerhost5.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::104:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host1.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.1.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host1.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::1:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host10.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.10.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host10.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::10:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host13.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.13.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host13.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::13:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host14.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.14.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host14.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::14:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host2.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.2.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host2.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::2:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host3.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.3.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host3.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::3:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.4.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::4:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host5.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.5.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host5.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::5:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host55.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.55.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host55.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::55:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host6.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.6.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host6.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::6:1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host7.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.7.1", "trustedBy": "cfg1.yahoo.com" }, { "hostname": "host7.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::7:1", "trustedBy": "cfg1.yahoo.com" }, { - "hostname": "test-container-1", + "hostname": "test-node-pool-101-2", "type": "tenant", - "ipAddress": "::2", + "ipAddress": "::101:2", "trustedBy": "cfg1.yahoo.com" } ], diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-docker-host.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-docker-host.json index 65db11acf08..2acc6d42282 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-docker-host.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-docker-host.json @@ -3,55 +3,67 @@ { "hostname": "cfg1.yahoo.com", "type": "config", - "ipAddress": "127.0.1.1", + "ipAddress": "127.0.201.1", + "trustedBy": "host4.yahoo.com" + }, + { + "hostname": "cfg1.yahoo.com", + "type": "config", + "ipAddress": "::201:1", + "trustedBy": "host4.yahoo.com" + }, + { + "hostname": "cfg2.yahoo.com", + "type": "config", + "ipAddress": "127.0.202.1", "trustedBy": "host4.yahoo.com" }, { "hostname": "cfg2.yahoo.com", "type": "config", - "ipAddress": "127.0.1.2", + "ipAddress": "::202:1", "trustedBy": "host4.yahoo.com" }, { "hostname": "dockerhost1.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.100.1", "trustedBy": "host4.yahoo.com" }, { "hostname": "dockerhost1.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::100:1", "trustedBy": "host4.yahoo.com" }, { - "hostname": "dockerhost3.yahoo.com", + "hostname": "dockerhost2.yahoo.com", "type": "host", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.101.1", "trustedBy": "host4.yahoo.com" }, { - "hostname": "dockerhost3.yahoo.com", + "hostname": "dockerhost2.yahoo.com", "type": "host", - "ipAddress": "::1", + "ipAddress": "::101:1", "trustedBy": "host4.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.4.1", "trustedBy": "host4.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::4:1", "trustedBy": "host4.yahoo.com" }, { - "hostname": "test-container-1", + "hostname": "test-node-pool-101-2", "type": "tenant", - "ipAddress": "::2", + "ipAddress": "::101:2", "trustedBy": "host4.yahoo.com" } ], diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-tenant-node.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-tenant-node.json index 75c9aaa2b5c..5fe28550837 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-tenant-node.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/acl-tenant-node.json @@ -3,157 +3,169 @@ { "hostname": "cfg1.yahoo.com", "type": "config", - "ipAddress": "127.0.1.1", + "ipAddress": "127.0.201.1", + "trustedBy": "foo.yahoo.com" + }, + { + "hostname": "cfg1.yahoo.com", + "type": "config", + "ipAddress": "::201:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "cfg2.yahoo.com", "type": "config", - "ipAddress": "127.0.1.2", + "ipAddress": "127.0.202.1", + "trustedBy": "foo.yahoo.com" + }, + { + "hostname": "cfg2.yahoo.com", + "type": "config", + "ipAddress": "::202:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "foo.yahoo.com", "type": "tenant", - "ipAddress": "(ignore)", + "ipAddress": "127.0.222.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host1.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.1.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host1.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::1:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host10.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.10.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host10.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::10:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host13.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.13.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host13.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::13:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host14.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.14.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host14.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::14:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host2.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.2.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host2.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::2:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host3.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.3.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host3.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::3:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.4.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host4.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::4:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host5.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.5.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host5.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::5:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host55.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.55.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host55.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::55:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host6.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.6.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host6.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::6:1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host7.yahoo.com", "type": "tenant", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.7.1", "trustedBy": "foo.yahoo.com" }, { "hostname": "host7.yahoo.com", "type": "tenant", - "ipAddress": "::1", + "ipAddress": "::7:1", "trustedBy": "foo.yahoo.com" }, { - "hostname": "test-container-1", + "hostname": "test-node-pool-101-2", "type": "tenant", - "ipAddress": "::2", + "ipAddress": "::101:2", "trustedBy": "foo.yahoo.com" } ], diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/active-nodes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/active-nodes.json index a5d8148c1e4..c61a755d989 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/active-nodes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/active-nodes.json @@ -1,10 +1,10 @@ { "nodes": [ @include(node6.json), + @include(docker-container1.json), @include(node13.json), @include(node2.json), @include(node14.json), - @include(docker-container1.json), @include(node4.json), @include(docker-node4.json), @include(docker-node5.json), diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json index f57f40ea171..e23f7129ae2 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json @@ -32,6 +32,9 @@ "agent": "system" } ], - "ipAddresses": ["127.0.1.1"], + "ipAddresses": [ + "127.0.201.1", + "::201:1" + ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json index 54cf3269b09..8e1accd65a2 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json @@ -32,6 +32,9 @@ "agent": "system" } ], - "ipAddresses": ["127.0.1.2"], + "ipAddresses": [ + "127.0.202.1", + "::202:1" + ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/content-nodes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/content-nodes.json index 47a2c012b17..e84f17dc40d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/content-nodes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/content-nodes.json @@ -1,8 +1,8 @@ { "nodes": [ @include(node6.json), - @include(node2.json), @include(docker-container1.json), + @include(node2.json), @include(node4.json) ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json index 5c3829bd5ff..253cfb1b225 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json @@ -1,11 +1,11 @@ { - "url": "http://localhost:8080/nodes/v2/node/test-container-1", - "id": "test-container-1", + "url": "http://localhost:8080/nodes/v2/node/test-node-pool-101-2", + "id": "test-node-pool-101-2", "state": "active", "type": "tenant", - "hostname": "test-container-1", - "parentHostname": "dockerhost3.yahoo.com", - "openStackId": "fake-test-container-1", + "hostname": "test-node-pool-101-2", + "parentHostname": "dockerhost2.yahoo.com", + "openStackId": "fake-test-node-pool-101-2", "flavor": "[vcpu: 1.0, memory: 1.0 Gb, disk 100.0 Gb]", "canonicalFlavor": "[vcpu: 1.0, memory: 1.0 Gb, disk 100.0 Gb]", "minDiskAvailableGb": 100.0, @@ -50,7 +50,7 @@ } ], "ipAddresses": [ - "::2" + "::101:2" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json index e01264a0c9d..5cbd372385a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-large", "minCpuCores": 4.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "zoneapp", @@ -62,12 +62,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.100.1", + "::100:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::100:2", + "::100:3", + "::100:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json index 5eebea57890..5cbd372385a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-large", "minCpuCores": 4.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "zoneapp", @@ -33,6 +33,7 @@ "allowedToBeDown": false, "rebootGeneration": 0, "currentRebootGeneration": 0, + "currentOsVersion": "7.5.2", "wantedOsVersion": "7.5.2", "failCount": 0, "hardwareFailure": false, @@ -61,12 +62,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.100.1", + "::100:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::100:2", + "::100:3", + "::100:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json index 213ebc5440f..cf190ff36bc 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json @@ -60,12 +60,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.100.1", + "::100:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::100:2", + "::100:3", + "::100:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json index eb0dc65e61b..4ffedbf01d5 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json @@ -60,12 +60,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.101.1", + "::101:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::101:2", + "::101:3", + "::101:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json index 326476f783a..396a645ea3b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json @@ -60,12 +60,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.102.1", + "::102:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::102:2", + "::102:3", + "::102:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json index c202376af9b..146af5998bd 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json @@ -60,12 +60,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.103.1", + "::103:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::103:2", + "::103:3", + "::103:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json index 3149a39ef32..5dadfe68845 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json @@ -60,12 +60,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.104.1", + "::104:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::104:2", + "::104:3", + "::104:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json index 7d3e0b43b53..637a7cc858d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json @@ -62,12 +62,12 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.100.1", + "::100:1" ], "additionalIpAddresses": [ - "::2", - "::3", - "::4" + "::100:2", + "::100:3", + "::100:4" ] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/load-balancers.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/load-balancers.json index c8738ab838c..d2c4d0ac857 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/load-balancers.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/load-balancers.json @@ -18,12 +18,12 @@ "reals": [ { "hostname": "host13.yahoo.com", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.13.1", "port": 4080 }, { "hostname": "host14.yahoo.com", - "ipAddress": "127.0.0.1", + "ipAddress": "127.0.14.1", "port": 4080 } ], diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json index 7d979676173..51855e17e8f 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant1", @@ -55,8 +55,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.1.1", + "::1:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json index 847fbd47bb7..73d39d133fc 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json @@ -13,7 +13,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant1", @@ -58,8 +58,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.10.1", + "::10:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json index 1584231f208..6e073bdac2b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.13.1", + "::13:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json index 462f6e2433f..411bbd50aba 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.14.1", + "::14:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json index 64b64888bcd..b564efc6eab 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.2.1", + "::2:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json index 66fa0179c35..90c835fd80b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json @@ -34,8 +34,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.3.1", + "::3:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json index 1cb1f6657e4..8068365e249 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json @@ -62,8 +62,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.4.1", + "::4:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json index 8a5c80212c7..8731b7383b9 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json @@ -38,8 +38,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.5.1", + "::5:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json index 08817a67324..2f5eb216af1 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json @@ -40,8 +40,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.5.1", + "::5:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json index 16ec6fe4a99..9b6a5634471 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "rebootGeneration": 1, "currentRebootGeneration": 0, @@ -33,8 +33,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.55.1", + "::55:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json index aca7875db31..857ad231cbe 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json @@ -33,8 +33,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.55.1", + "::55:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json index a15b62a6dd4..4e6684f9ccd 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json @@ -7,13 +7,13 @@ "openStackId": "node6", "flavor": "default", "canonicalFlavor": "default", - "minDiskAvailableGb":400.0, - "minMainMemoryAvailableGb":16.0, - "description":"Flavor-name-is-default", - "minCpuCores":2.0, - "fastDisk":true, - "bandwidth":0.0, - "environment":"BARE_METAL", + "minDiskAvailableGb": 400.0, + "minMainMemoryAvailableGb": 16.0, + "description": "Flavor-name-is-default", + "minCpuCores": 2.0, + "fastDisk": true, + "bandwidth": 0.0, + "environment": "BARE_METAL", "owner": { "tenant": "tenant2", "application": "application2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.6.1", + "::6:1" ], "additionalIpAddresses": [], "hardwareDivergence": "{\"actualCpuCores\":2}" diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json index c1b05045ff1..9e63da8cd5d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.6.1", + "::6:1" ], "additionalIpAddresses": [], "reports": { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json index ac34074c4fd..55d804ba094 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.6.1", + "::6:1" ], "additionalIpAddresses": [], "reports": { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json index cfe361549c7..3d430082f11 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.6.1", + "::6:1" ], "additionalIpAddresses": [], "reports": { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json index c1321aa113a..dbec9c1a1f8 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json @@ -12,7 +12,7 @@ "description": "Flavor-name-is-default", "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, + "bandwidth": 0.0, "environment": "BARE_METAL", "owner": { "tenant": "tenant2", @@ -60,8 +60,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.6.1", + "::6:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json index e6e06c74cdc..4e17f571ef3 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json @@ -28,8 +28,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.7.1", + "::7:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json index a768cf73dda..ab69b6b1d5a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json @@ -28,7 +28,7 @@ } ], "ipAddresses": [ - "127.0.0.1" + "127.0.8.1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json index 019eef8c1f2..271ff3feef1 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json @@ -28,8 +28,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.9.1", + "::9:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes-recursive.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes-recursive.json index 5f51f53fb2b..123344f4aac 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes-recursive.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes-recursive.json @@ -9,13 +9,13 @@ @include(docker-node4.json), @include(node6.json), @include(docker-node5.json), + @include(docker-container1.json), @include(docker-node2.json), @include(node13.json), @include(node2.json), @include(docker-node1.json), @include(docker-node3.json), @include(node14.json), - @include(docker-container1.json), @include(node4.json), @include(node55.json), @include(node5.json) diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes.json index 8f29a774fb4..a45e239c2b6 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/nodes.json @@ -28,6 +28,9 @@ "url": "http://localhost:8080/nodes/v2/node/dockerhost5.yahoo.com" }, { + "url": "http://localhost:8080/nodes/v2/node/test-node-pool-101-2" + }, + { "url": "http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com" }, { @@ -46,9 +49,6 @@ "url": "http://localhost:8080/nodes/v2/node/host14.yahoo.com" }, { - "url": "http://localhost:8080/nodes/v2/node/test-container-1" - }, - { "url": "http://localhost:8080/nodes/v2/node/host4.yahoo.com" }, { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json index 45668ca341d..ec319edb170 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json @@ -28,8 +28,8 @@ } ], "ipAddresses": [ - "127.0.0.1", - "::1" + "127.0.127.1", + "::127:1" ], "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/states-recursive.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/states-recursive.json index 5d90346eec7..c13dca5439a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/states-recursive.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/states-recursive.json @@ -25,10 +25,10 @@ "url": "http://localhost:8080/nodes/v2/state/active", "nodes": [ @include(node6.json), + @include(docker-container1.json), @include(node13.json), @include(node2.json), @include(node14.json), - @include(docker-container1.json), @include(node4.json), @include(docker-node4.json), @include(docker-node5.json), |