mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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:
38
api/runner/task.go
Normal file
38
api/runner/task.go
Normal 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())
|
||||
}
|
||||
Reference in New Issue
Block a user