fix runner to use global instance

This commit is contained in:
Henrique Chehad
2016-08-22 20:12:02 -03:00
parent 148d52c890
commit 459620f9b4
2 changed files with 1 additions and 8 deletions

View File

@@ -17,7 +17,6 @@ var (
ErrAppsNothingToUpdate = errors.New("Nothing to update") ErrAppsNothingToUpdate = errors.New("Nothing to update")
ErrAppsMissingNew = errors.New("Missing new application") ErrAppsMissingNew = errors.New("Missing new application")
ErrUsableImage = errors.New("Image not found") ErrUsableImage = errors.New("Image not found")
ErrNewRunnerDriver = errors.New("Error creating the runner driver")
) )
type App struct { type App struct {

View File

@@ -38,13 +38,7 @@ func handleRouteCreate(c *gin.Context) {
return return
} }
run, err := runner.New() err = Api.Runner.EnsureUsableImage(&runner.Config{
if err != nil {
c.JSON(http.StatusInternalServerError, simpleError(models.ErrNewRunnerDriver))
return
}
err = run.EnsureUsableImage(&runner.Config{
Ctx: ctx, Ctx: ctx,
Route: wroute.Route, Route: wroute.Route,
}) })