get the resource.Info out of the conversion business

This commit is contained in:
David Eads
2018-04-30 09:25:45 -04:00
parent cb4ce3392d
commit 1e5372b620
20 changed files with 74 additions and 49 deletions

View File

@@ -739,7 +739,7 @@ func (o *DrainOptions) RunCordonOrUncordon(desired bool) error {
fmt.Printf("error: %v", err)
continue
}
printer.PrintObj(nodeInfo.AsVersioned(legacyscheme.Scheme), o.Out)
printer.PrintObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
} else {
if !o.DryRun {
helper := resource.NewHelper(o.restClient, nodeInfo.Mapping)
@@ -765,7 +765,7 @@ func (o *DrainOptions) RunCordonOrUncordon(desired bool) error {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printer.PrintObj(nodeInfo.AsVersioned(legacyscheme.Scheme), o.Out)
printer.PrintObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
} else {
printer, err := o.ToPrinter("skipped")
@@ -773,7 +773,7 @@ func (o *DrainOptions) RunCordonOrUncordon(desired bool) error {
fmt.Fprintf(o.ErrOut, "%v", err)
continue
}
printer.PrintObj(nodeInfo.AsVersioned(legacyscheme.Scheme), o.Out)
printer.PrintObj(cmdutil.AsDefaultVersionedOrOriginal(nodeInfo.Object, nodeInfo.Mapping), o.Out)
}
}