mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
server updates (#566)
* server updates - improved route create/update validation/defaults - improved/added route test cases * cleanup * negative concurrency check
This commit is contained in:
committed by
Seif Lotfy سيف لطفي
parent
8a9678e4af
commit
1d0ba54b35
@@ -31,18 +31,14 @@ func (s *Server) handleRouteCreate(c *gin.Context) {
|
||||
|
||||
wroute.Route.AppName = c.MustGet(api.AppName).(string)
|
||||
|
||||
if err := wroute.Validate(); err != nil {
|
||||
wroute.Route.SetDefaults()
|
||||
|
||||
if err := wroute.Validate(false); err != nil {
|
||||
log.WithError(err).Debug(models.ErrRoutesCreate)
|
||||
c.JSON(http.StatusBadRequest, simpleError(err))
|
||||
return
|
||||
}
|
||||
|
||||
if wroute.Route.Image == "" {
|
||||
log.WithError(models.ErrRoutesValidationMissingImage).Debug(models.ErrRoutesCreate)
|
||||
c.JSON(http.StatusBadRequest, simpleError(models.ErrRoutesValidationMissingImage))
|
||||
return
|
||||
}
|
||||
|
||||
// err = s.Runner.EnsureImageExists(ctx, &task.Config{
|
||||
// Image: wroute.Route.Image,
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user