More sensible container names for Mesos/Marathon (#1316)

* Collect container environment variales (close #1314)

* Containers managed by Marathon can have meaningful names (close #1309)

* Make linter happy and fix tests
This commit is contained in:
Ilya Dmitrichenko
2016-04-18 12:10:18 +01:00
committed by Tom Wilkie
parent 49f79649ed
commit a49c3893de
4 changed files with 82 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ const (
// Keys we use to render container names
AmazonECSContainerNameLabel = "com.amazonaws.ecs.container-name"
KubernetesContainerNameLabel = "io.kubernetes.container.name"
MarathonAppIDEnv = "MARATHON_APP_ID"
)
// NodeSummaryGroup is a topology-typed group of children for a Node.
@@ -370,6 +371,9 @@ func getRenderableContainerName(nmd report.Node) string {
// is only provided by Kubernetes versions >= 1.2 (see
// https://github.com/kubernetes/kubernetes/pull/17234/ )
docker.LabelPrefix + KubernetesContainerNameLabel,
// Marathon doesn't set any Docker labels and this is the only meaningful
// attribute we can find to make Scope useful without Mesos plugin
docker.EnvPrefix + MarathonAppIDEnv,
docker.ContainerName,
docker.ContainerHostname,
} {