mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add required memory configuration to Route
This commit is contained in:
@@ -24,6 +24,7 @@ type Route struct {
|
||||
AppName string `json:"appname,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
Memory uint64 `json:"memory,omitempty"`
|
||||
Headers http.Header `json:"headers,omitempty"`
|
||||
Config `json:"config"`
|
||||
}
|
||||
@@ -43,6 +44,10 @@ func (r *Route) Validate() error {
|
||||
res = append(res, ErrRoutesValidationMissingImage)
|
||||
}
|
||||
|
||||
if r.Memory == 0 {
|
||||
r.Memory = 128
|
||||
}
|
||||
|
||||
if r.AppName == "" {
|
||||
res = append(res, ErrRoutesValidationMissingAppName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user