Add validate function to crd resource and do validate before creation/update (#580)

This commit is contained in:
Ta-Ching Chen
2018-04-08 00:56:13 +08:00
committed by GitHub
parent 12299df811
commit d01b309fc7
26 changed files with 718 additions and 118 deletions
-6
View File
@@ -60,12 +60,6 @@ func (a *API) EnvironmentApiCreate(w http.ResponseWriter, r *http.Request) {
return
}
err = validateResourceName(env.Metadata.Name)
if err != nil {
a.respondWithError(w, err)
return
}
enew, err := a.fissionClient.Environments(env.Metadata.Namespace).Create(&env)
if err != nil {
a.respondWithError(w, err)