Fixes get -oname for unstructured objects

This commit is contained in:
Fabiano Franz
2017-04-25 18:11:48 -03:00
parent 98398d5d6e
commit 1aa84d101a
3 changed files with 20 additions and 17 deletions

View File

@@ -46,7 +46,10 @@ func NewBuilderFactory(clientAccessFactory ClientAccessFactory, objectMappingFac
}
func (f *ring2Factory) PrinterForCommand(cmd *cobra.Command) (printers.ResourcePrinter, bool, error) {
mapper, typer := f.objectMappingFactory.Object()
mapper, typer, err := f.objectMappingFactory.UnstructuredObject()
if err != nil {
return nil, false, err
}
// TODO: used by the custom column implementation and the name implementation, break this dependency
decoders := []runtime.Decoder{f.clientAccessFactory.Decoder(true), unstructured.UnstructuredJSONScheme}
return PrinterForCommand(cmd, mapper, typer, decoders)