From 6ccc4381690d88cdac62645f31d2390af8fc017a Mon Sep 17 00:00:00 2001 From: hurf Date: Wed, 26 Aug 2015 16:45:11 +0800 Subject: [PATCH] Use exsiting print function in label command Instead of getting printer in the code, use exsiting function. --- pkg/kubectl/cmd/label.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go index db7260cb7df..aa57df0e128 100644 --- a/pkg/kubectl/cmd/label.go +++ b/pkg/kubectl/cmd/label.go @@ -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 })