Fix validation by moving it into the resource builder.

Also always print an error for unknown field.
This commit is contained in:
Brendan Burns
2015-05-07 13:53:43 -07:00
parent 35c644a45f
commit 7f11585972
6 changed files with 57 additions and 11 deletions

View File

@@ -143,7 +143,12 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
var newRc *api.ReplicationController
if len(filename) != 0 {
schema, err := f.Validator()
if err != nil {
return err
}
obj, err := resource.NewBuilder(mapper, typer, f.ClientMapperForCommand()).
Schema(schema).
NamespaceParam(cmdNamespace).RequireNamespace().
FilenameParam(filename).
Do().