This is an automated email from the ASF dual-hosted git repository. grag pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 7d08b667e446840dc31538d9d40705e3d8fb12a0 Author: Greg Mann <g...@mesosphere.io> AuthorDate: Mon Jul 15 10:25:35 2019 -0700 Added the DrainConfig to agent API outputs. Review: https://reviews.apache.org/r/70835/ --- include/mesos/agent/agent.proto | 2 ++ include/mesos/v1/agent/agent.proto | 2 ++ src/slave/http.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/include/mesos/agent/agent.proto b/include/mesos/agent/agent.proto index 83eb7bb..3cb622d 100644 --- a/include/mesos/agent/agent.proto +++ b/include/mesos/agent/agent.proto @@ -569,6 +569,8 @@ message Response { // Contains the agent's information. message GetAgent { optional SlaveInfo slave_info = 1; + + optional DrainConfig drain_config = 2; } // Lists information about all resource providers known to the agent diff --git a/include/mesos/v1/agent/agent.proto b/include/mesos/v1/agent/agent.proto index f6574cb..4324ad6 100644 --- a/include/mesos/v1/agent/agent.proto +++ b/include/mesos/v1/agent/agent.proto @@ -569,6 +569,8 @@ message Response { // Contains the agent's information. message GetAgent { optional AgentInfo agent_info = 1; + + optional DrainConfig drain_config = 2; } // Lists information about all resource providers known to the agent diff --git a/src/slave/http.cpp b/src/slave/http.cpp index 69e6d74..321dca7 100644 --- a/src/slave/http.cpp +++ b/src/slave/http.cpp @@ -1331,6 +1331,12 @@ Future<Response> Http::state( writer->field("domain", slave->info.domain()); } + if (slave->drainConfig.isSome()) { + writer->field( + "drain_config", + JSON::Protobuf(slave->drainConfig.get())); + } + const Resources& totalResources = slave->totalResources; writer->field("resources", totalResources); @@ -1842,6 +1848,11 @@ Future<Response> Http::getAgent( response.mutable_get_agent()->mutable_slave_info()->CopyFrom(slave->info); + if (slave->drainConfig.isSome()) { + response.mutable_get_agent()->mutable_drain_config()->CopyFrom( + slave->drainConfig.get()); + } + return OK(serialize(acceptType, evolve(response)), stringify(acceptType)); }