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

@@ -389,7 +389,10 @@ func RunCreateSubcommand(f cmdutil.Factory, options *CreateSubcommandOptions) er
if err != nil {
return err
}
mapper := f.RESTMapper()
mapper, err := f.RESTMapper()
if err != nil {
return err
}
if !options.DryRun {
// create subcommands have compiled knowledge of things they create, so type them directly
gvks, _, err := legacyscheme.Scheme.ObjectKinds(obj)