@@ -374,15 +374,15 @@ func (h *handler) handleResources(w http.ResponseWriter, r *http.Request) {
374374 return
375375 }
376376
377- modules , err := h .listCollectionModules (r .Context (), providerCluster )
377+ templates , err := h .listCollectionTemplates (r .Context (), providerCluster )
378378 if err != nil {
379379 logger .Error (err , "failed to get dynamic resources" )
380380 http .Error (w , "internal error" , http .StatusInternalServerError )
381381 return
382382 }
383383
384- result := make ([]UISchema , 0 , len (modules .Items ))
385- for _ , item := range modules .Items {
384+ result := make ([]UISchema , 0 , len (templates .Items ))
385+ for _ , item := range templates .Items {
386386 if ! strings .EqualFold (h .scope .String (), string (item .Spec .Scope )) && h .scope != kubebindv1alpha2 .ClusterScope {
387387 continue
388388 }
@@ -523,11 +523,11 @@ func mustRead(f func(name string) ([]byte, error), name string) string {
523523 return string (bs )
524524}
525525
526- // listCollectionModules fetches the list of Collections from the backend cluster.
526+ // listCollectionTemplates fetches the list of Collections from the backend cluster.
527527// Flow is:
528528// 1. List Collection and check what modules we are targeting
529- // 2. Get modules from the backend cluster and consutruct shallow-bound schemas (no crd content).
530- func (h * handler ) listCollectionModules (ctx context.Context , cluster string ) (* kubebindv1alpha2.APIServiceExportTemplateList , error ) {
529+ // 2. Get templates from the backend cluster and consutruct shallow-bound schemas (no crd content).
530+ func (h * handler ) listCollectionTemplates (ctx context.Context , cluster string ) (* kubebindv1alpha2.APIServiceExportTemplateList , error ) {
531531 collections , err := h .kubeManager .ListCollections (ctx , cluster )
532532 if err != nil {
533533 return nil , fmt .Errorf ("failed to list collections: %w" , err )
0 commit comments