mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
add resource prefix to multiple items w/ same kind
This patch ensures that a resource prefix is added to multiple items of the same kind, when using `oc get all`. Before, a prefix was added only when a single item was returned on `oc get all`, but ignored if only a single resource kind existed but multiple items for that kind were returned.
This commit is contained in:
@@ -629,13 +629,9 @@ func MaybeConvertObject(obj runtime.Object, gv schema.GroupVersion, converter ru
|
||||
// with multiple resource kinds, in which case it will
|
||||
// return true, indicating resource kind will be
|
||||
// included as part of printer output
|
||||
func MustPrintWithKinds(objs []runtime.Object, infos []*resource.Info, sorter *kubectl.RuntimeSort, printAll bool) bool {
|
||||
func MustPrintWithKinds(objs []runtime.Object, infos []*resource.Info, sorter *kubectl.RuntimeSort) bool {
|
||||
var lastMap *meta.RESTMapping
|
||||
|
||||
if len(infos) == 1 && printAll {
|
||||
return true
|
||||
}
|
||||
|
||||
for ix := range objs {
|
||||
var mapping *meta.RESTMapping
|
||||
if sorter != nil {
|
||||
|
||||
Reference in New Issue
Block a user