ignore clusterName on create and update

This commit is contained in:
jianhuiz
2016-08-18 22:06:49 -07:00
parent 7be20b0dac
commit 858e515f85
3 changed files with 59 additions and 0 deletions

View File

@@ -71,6 +71,9 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx api.Context, obj runtime.Obje
api.FillObjectMetaSystemFields(ctx, objectMeta)
api.GenerateName(strategy, objectMeta)
// ClusterName is ignored and should not be saved
objectMeta.ClusterName = ""
if errs := strategy.Validate(ctx, obj); len(errs) > 0 {
return errors.NewInvalid(kind.GroupKind(), objectMeta.Name, errs)
}