Remove unstructured error checking from affected code

Also remove error messages that depended on ObjectKinds() - future
changes will potentially remove this interface and the replacements here
are equivalent.
This commit is contained in:
Clayton Coleman
2017-11-14 22:10:35 -05:00
parent e298aa39c3
commit 7563a0c4d8
9 changed files with 20 additions and 62 deletions

View File

@@ -222,11 +222,7 @@ func RunPatch(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []strin
if len(options.OutputFormat) > 0 && options.OutputFormat != "name" {
return f.PrintResourceInfoForCommand(cmd, info, out)
}
mapper, _, err := f.UnstructuredObject()
if err != nil {
return err
}
f.PrintSuccess(mapper, options.OutputFormat == "name", out, info.Mapping.Resource, info.Name, false, dataChangedMsg)
f.PrintSuccess(r.Mapper().RESTMapper, options.OutputFormat == "name", out, info.Mapping.Resource, info.Name, false, dataChangedMsg)
// if object was not successfully patched, exit with error code 1
if !didPatch {