fix runner changes (#132)

Fix runner changes
This commit is contained in:
Pedro Nasser
2016-10-07 13:49:16 -03:00
committed by C Cirello
parent 970412ba88
commit 52f78eb601
4 changed files with 76 additions and 50 deletions

View File

@@ -157,7 +157,6 @@ func (r *Runner) Run(ctx context.Context, cfg *Config) (drivers.RunResult, error
ctask := &containerTask{
ctx: ctx,
cfg: cfg,
auth: &common.ConfigAuth{},
canRun: make(chan bool),
}
@@ -215,15 +214,11 @@ func (r *Runner) Run(ctx context.Context, cfg *Config) (drivers.RunResult, error
func (r Runner) EnsureImageExists(ctx context.Context, cfg *Config) error {
ctask := &containerTask{
cfg: cfg,
auth: &common.ConfigAuth{},
cfg: cfg,
}
err := r.driver.EnsureImageExists(ctx, ctask)
if err != nil {
return err
}
return nil
_, err := docker.CheckRegistry(ctask.Image(), ctask.DockerAuth())
return err
}
func selectDriver(driver string, env *common.Environment, conf *driverscommon.Config) (drivers.Driver, error) {

View File

@@ -4,14 +4,12 @@ import (
"context"
"io"
dockercli "github.com/fsouza/go-dockerclient"
"github.com/iron-io/runner/common"
"github.com/fsouza/go-dockerclient"
"github.com/iron-io/runner/drivers"
)
type containerTask struct {
ctx context.Context
auth *common.ConfigAuth
cfg *Config
canRun chan bool
}
@@ -42,6 +40,5 @@ func (t *containerTask) WorkDir() string { return "" }
func (t *containerTask) Close() {}
func (t *containerTask) WriteStat(drivers.Stat) {}
func (t *containerTask) DockerAuth() []dockercli.AuthConfiguration {
return t.auth.Auth(t.Image())
}
// FIXME: for now just use empty creds => public docker hub image
func (t *containerTask) DockerAuth() docker.AuthConfiguration { return docker.AuthConfiguration{} }