add required memory configuration to Route

This commit is contained in:
Pedro Nasser
2016-09-09 00:53:46 -03:00
parent 77813b1d3f
commit f461312553
2 changed files with 13 additions and 3 deletions

View File

@@ -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)
}