Parse metadata.Name before creating tpr resource (#284)

This commit is contained in:
Ta-Ching Chen
2017-08-14 08:55:31 -07:00
committed by Soam Vasani
parent 45f3095fb1
commit a52425a31d
7 changed files with 47 additions and 0 deletions
+6
View File
@@ -61,6 +61,12 @@ func (a *API) FunctionApiCreate(w http.ResponseWriter, r *http.Request) {
return
}
err = validateResourceName(f.Metadata.Name)
if err != nil {
a.respondWithError(w, err)
return
}
// Ensure size limits
if len(f.Spec.Source.Literal) > 256*1024 {
err := fission.MakeError(fission.ErrorInvalidArgument, "Source package literal larger than 256K")