From 6a369eb23a3d14e6bb5a9ecdd7d02babb5c16f86 Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Tue, 16 Aug 2016 14:45:25 +1200 Subject: [PATCH] Update deps; add container label for logs --- api/runner/runner.go | 1 + api/runner/task.go | 6 ++++++ api/server/runner.go | 1 + glide.lock | 4 ++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api/runner/runner.go b/api/runner/runner.go index 69293bff7..997681b5c 100644 --- a/api/runner/runner.go +++ b/api/runner/runner.go @@ -23,6 +23,7 @@ type Config struct { Payload string Timeout time.Duration RequestURL string + AppName string } type Runner struct { diff --git a/api/runner/task.go b/api/runner/task.go index b0a8629fe..5605848e5 100644 --- a/api/runner/task.go +++ b/api/runner/task.go @@ -24,6 +24,12 @@ func (t *containerTask) EnvVars() map[string]string { return env } +func (t *containerTask) Labels() map[string]string { + return map[string]string{ + "LogName": t.cfg.AppName, + } +} + func (t *containerTask) Id() string { return t.cfg.ID } func (t *containerTask) Group() string { return "" } func (t *containerTask) Image() string { return t.cfg.Route.Image } diff --git a/api/server/runner.go b/api/server/runner.go index fef39e7e3..7ba33a07c 100644 --- a/api/server/runner.go +++ b/api/server/runner.go @@ -116,6 +116,7 @@ func handleRunner(c *gin.Context) { Timeout: 30 * time.Second, ID: reqID, RequestURL: c.Request.URL.String(), + AppName: appName, }) if err := run.Run(); err != nil { diff --git a/glide.lock b/glide.lock index 65f92aa9a..92ef802f9 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 5ccf89905e13b7dc987cd203c1d7c1fddd32dcd776fe2e5f60d9f6f7b9908425 -updated: 2016-08-07T13:44:07.250867774-04:00 +updated: 2016-08-16T14:52:37.933227014+12:00 imports: - name: github.com/amir/raidman version: c74861fe6a7bb8ede0a010ce4485bdbb4fc4c985 @@ -100,7 +100,7 @@ imports: subpackages: - registry - name: github.com/iron-io/titan - version: a55b68c6ff4c750886542e788b87db80dda7c47a + version: e309e9971583fd1b9894b250a28cb194d90e8ac5 repo: https://github.com/iron-io/titan.git vcs: git subpackages: