diff --git a/pkg/registry/core/resourcesummary/storage.go b/pkg/registry/core/resourcesummary/storage.go index f82cc49ac..56a00966c 100644 --- a/pkg/registry/core/resourcesummary/storage.go +++ b/pkg/registry/core/resourcesummary/storage.go @@ -18,6 +18,7 @@ package ResourceSummary import ( "context" + ksets "kmodules.xyz/sets" "sort" "strings" "time" @@ -111,12 +112,21 @@ func (r *Storage) List(ctx context.Context, options *internalversion.ListOptions selector := shared.NewGroupKindSelector(options.LabelSelector) now := time.Now() + universe := ksets.NewGroupKind() + items := make([]rscoreapi.ResourceSummary, 0) for _, gvk := range api.RegisteredTypes() { if !selector.Matches(gvk.GroupKind()) { continue } + gk := gvk.GroupKind() + if universe.Has(gk) { + continue + } else { + universe.Insert(gk) + } + mapping, err := r.kc.RESTMapper().RESTMapping(gvk.GroupKind(), gvk.Version) if meta.IsNoMatchError(err) { continue