Use exsiting print function in label command

Instead of getting printer in the code, use exsiting function.
pull/6/head
hurf 2015-08-26 16:45:11 +08:00
parent 00e34429e0
commit 6ccc438169
1 changed files with 1 additions and 5 deletions

View File

@ -218,11 +218,7 @@ func RunLabel(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
if outputFormat == "" {
cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, "labeled")
} else {
printer, err := f.PrinterForMapping(cmd, info.Mapping, false)
if err != nil {
return err
}
return printer.PrintObj(obj, out)
f.PrintObject(cmd, obj, out)
}
return nil
})