aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoby <smorgrav@yahoo-inc.com>2018-02-14 15:24:54 +0100
committertoby <smorgrav@yahoo-inc.com>2018-02-14 15:24:54 +0100
commit222730f5ff40dd66a349662c88c64548446a27a4 (patch)
treeed2be4e525ac9309fda2472aac9c7d90bcc17e9b
parentd6624fca2b590536dcb67b1e600b5f9975a62117 (diff)
Remove unused code, move out static strings
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java13
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/NetworkPrefixTranslator.java2
2 files changed, 6 insertions, 9 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java
index 96cde6f9f64..b30cac2476e 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java
@@ -45,6 +45,9 @@ public class DockerOperationsImpl implements DockerOperations {
private static final String MANAGER_NAME = "node-admin";
+ private static final String LOCAL_IPV6_PREFIX = "fd00::";
+ private static final String DOCKER_CUSTOM_BRIDGE_NETWORK_NAME = "vespa-bridge";
+
// Map of directories to mount and whether they should be writable by everyone
private static final Map<String, Boolean> DIRECTORIES_TO_MOUNT = new HashMap<>();
@@ -121,17 +124,15 @@ public class DockerOperationsImpl implements DockerOperations {
.withAddCapability("SYS_ADMIN"); // Needed for perf
if (!docker.networkNPTed()) {
- logger.info("Network is macvlan - setting up container with public ip address on a macvlan");
command.withIpAddress(nodeInetAddress);
command.withNetworkMode(DockerImpl.DOCKER_CUSTOM_MACVLAN_NETWORK_NAME);
command.withVolume("/etc/hosts", "/etc/hosts"); // TODO This is probably not nessesary - review later
} else {
- logger.info("Network is NPTed - setting up container with private ip address");
command.withIpAddress(NetworkPrefixTranslator.translate(
nodeInetAddress,
- InetAddress.getByName("fd00::"),
+ InetAddress.getByName(LOCAL_IPV6_PREFIX),
64));
- command.withNetworkMode("vespa-bridge");
+ command.withNetworkMode(DOCKER_CUSTOM_BRIDGE_NETWORK_NAME);
}
for (String pathInNode : DIRECTORIES_TO_MOUNT.keySet()) {
@@ -168,10 +169,6 @@ public class DockerOperationsImpl implements DockerOperations {
}
}
- private InetAddress toPrivateSubnet(InetAddress nodeInetAddress) {
- return null;
- }
-
@Override
public void removeContainer(final Container existingContainer, ContainerNodeSpec nodeSpec) {
final ContainerName containerName = existingContainer.name;
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/NetworkPrefixTranslator.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/NetworkPrefixTranslator.java
index 70c58def24f..a52dedb90e5 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/NetworkPrefixTranslator.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/NetworkPrefixTranslator.java
@@ -16,7 +16,7 @@ class NetworkPrefixTranslator {
*
* @param address The original address to translate
* @param prefix The prefix address
- * @param subnetSize nof bits - e.g /64 subnet is 64
+ * @param subnetSize in bits - e.g a /64 subnet equals 64 bits
* @return The translated address
*/
static Inet6Address translate(InetAddress address, InetAddress prefix, int subnetSize) {