mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
rebase/merging runner
This commit is contained in:
@@ -16,6 +16,7 @@ var (
|
||||
ErrAppsNotFound = errors.New("App not found")
|
||||
ErrAppsNothingToUpdate = errors.New("Nothing to update")
|
||||
ErrAppsMissingNew = errors.New("Missing new application")
|
||||
ErrUsableImage = errors.New("Image not found")
|
||||
)
|
||||
|
||||
type App struct {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/iron-io/functions/api/models"
|
||||
"github.com/iron-io/functions/api/runner"
|
||||
titancommon "github.com/iron-io/titan/common"
|
||||
)
|
||||
|
||||
@@ -37,6 +38,17 @@ func handleRouteCreate(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
run := runner.New(&runner.Config{
|
||||
Ctx: ctx,
|
||||
Route: wroute.Route,
|
||||
})
|
||||
|
||||
err = run.EnsureUsableImage()
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, simpleError(models.ErrUsableImage))
|
||||
return
|
||||
}
|
||||
|
||||
app, err := Api.Datastore.GetApp(wroute.Route.AppName)
|
||||
if err != nil {
|
||||
log.WithError(err).Error(models.ErrAppsGet)
|
||||
|
||||
Reference in New Issue
Block a user