Sort items returned by plugin response
@@ -459,6 +459,19 @@ func (m *Manager) Print(ctx context.Context, object runtime.Object) (*PrintRespo
close(ch)
<-done
+
+ // Attempt to eliminate whitespace before fallback
+ sort.Slice(pr.Items, func(i, j int) bool {
+ if a, b := pr.Items[i].Width, pr.Items[j].Width; a != b {
+ return a < b
+ }
+
+ a, _ := component.TitleFromTitleComponent(pr.Items[i].View.GetMetadata().Title)
+ b, _ := component.TitleFromTitleComponent(pr.Items[j].View.GetMetadata().Title)
+
+ return a < b
+ })
+
return &pr, nil
}
