You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2017/07/07 01:12:04 UTC

[2/2] mesos git commit: Added initialization logic in Mesos agent for IPv6 flags.

Added initialization logic in Mesos agent for IPv6 flags.

Operators can now set the IPv6 address for the agent using the `--ip6`
and `--ip6_discovery_command` flags. Currently, the only place the agent
will use the IPv6 address would be to advertise v6 addresses for
containers running on the host network.

Review: https://reviews.apache.org/r/59128/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c90bea80
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c90bea80
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c90bea80

Branch: refs/heads/master
Commit: c90bea80486c089e933bef64aca341e4cfaaef25
Parents: 9b91147
Author: Avinash sridharan <av...@mesosphere.io>
Authored: Thu Jul 6 18:11:47 2017 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Thu Jul 6 18:11:47 2017 -0700

----------------------------------------------------------------------
 src/slave/main.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c90bea80/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 66ae7db..358a439 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -296,6 +296,11 @@ int main(int argc, char** argv)
         "Only one of `--ip` or `--ip_discovery_command` should be specified");
   }
 
+  if (flags.ip6_discovery_command.isSome() && flags.ip6.isSome()) {
+    EXIT(EXIT_FAILURE) << flags.usage(
+        "Only one of `--ip6` or `--ip6_discovery_command` should be specified");
+  }
+
   if (flags.ip_discovery_command.isSome()) {
     Try<string> ipAddress = os::shell(flags.ip_discovery_command.get());
 
@@ -308,6 +313,17 @@ int main(int argc, char** argv)
     os::setenv("LIBPROCESS_IP", flags.ip.get());
   }
 
+  if (flags.ip6_discovery_command.isSome()) {
+    Try<string> ip6Address = os::shell(flags.ip6_discovery_command.get());
+    if (ip6Address.isError()) {
+      EXIT(EXIT_FAILURE) << ip6Address.error();
+    }
+
+    os::setenv("LIBPROCESS_IP6", strings::trim(ip6Address.get()));
+  } else if (flags.ip6.isSome()) {
+    os::setenv("LIBPROCESS_IP6", flags.ip.get());
+  }
+
   os::setenv("LIBPROCESS_PORT", stringify(flags.port));
 
   if (flags.advertise_ip.isSome()) {