Skip to content

Commit

Permalink
Merge pull request #37 from juanvallejo/deads2k/rebase19
Browse files Browse the repository at this point in the history
Make Printers Work Again
  • Loading branch information
deads2k authored Dec 6, 2017
2 parents ef74f7a + e48d5d2 commit af4137f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/oc/cli/util/clientcmd/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ func NewFactory(optionalClientConfig kclientcmd.ClientConfig) *Factory {
// otherwise, it iterates through info objects, printing each resource with a unique printer for its mapping
func (f *Factory) PrintResourceInfos(cmd *cobra.Command, isLocal bool, infos []*resource.Info, out io.Writer) error {
// mirrors PrintResourceInfoForCommand upstream
printer, err := f.PrinterForCommand(cmd, isLocal, nil, printers.PrintOptions{})
opts := kcmdutil.ExtractCmdPrintOptions(cmd, false)
printer, err := f.PrinterForOptions(opts)
if err != nil {
return nil
}
if !printer.IsGeneric() {
for _, info := range infos {
mapping := info.ResourceMapping()
printer, err := f.PrinterForMapping(cmd, isLocal, nil, mapping, false)
printer, err := f.PrinterForMapping(opts, mapping)
if err != nil {
return err
}
Expand Down

0 comments on commit af4137f

Please sign in to comment.