acknowledge that creation of a restmapper can fail and that we cannot have a default

This commit is contained in:
David Eads
2018-04-30 08:04:43 -04:00
parent ef0d1ab819
commit 1cb797e355
26 changed files with 130 additions and 85 deletions

View File

@@ -643,7 +643,10 @@ func (o *RunOptions) createGeneratedObject(f cmdutil.Factory, cmd *cobra.Command
return nil, err
}
mapper := f.RESTMapper()
mapper, err := f.RESTMapper()
if err != nil {
return nil, err
}
// run has compiled knowledge of the thing is is creating
groupVersionKinds, _, err := legacyscheme.Scheme.ObjectKinds(obj)
if err != nil {