multiple ajustments

- renamed WrapperJob (not exported anymore)
- removed need for temp log file
- not using titan models
- using gin.Context as runner context
This commit is contained in:
Pedro Nasser
2016-07-28 17:45:57 -03:00
parent a92dffb3fc
commit d7f1ea037b
5 changed files with 65 additions and 86 deletions

38
api/runner/task.go Normal file
View File

@@ -0,0 +1,38 @@
package runner
import (
"io"
dockercli "github.com/fsouza/go-dockerclient"
"github.com/iron-io/titan/runner/tasker"
)
type containerTask struct {
auth tasker.Auther
stdout io.Writer
stderr io.Writer
cfg *Config
}
func (t *containerTask) Command() string { return "" }
func (t *containerTask) EnvVars() map[string]string {
env := map[string]string{
"PAYLOAD": t.cfg.Payload,
}
return env
}
func (t *containerTask) Id() string { return "" }
func (t *containerTask) Group() string { return "" }
func (t *containerTask) Image() string { return t.cfg.Route.Image }
func (t *containerTask) Timeout() uint { return uint(t.cfg.Timeout.Seconds()) }
func (t *containerTask) Logger() (stdout, stderr io.Writer) { return t.stdout, t.stderr }
func (t *containerTask) Volumes() [][2]string { return [][2]string{} }
func (t *containerTask) WorkDir() string { return "" }
func (t *containerTask) Close() {}
func (t *containerTask) DockerAuth() []dockercli.AuthConfiguration {
return t.auth.Auth(t.Image())
}