Skip to content

Commit 123f537

Browse files
committed
cleanup
1 parent db0166e commit 123f537

4 files changed

Lines changed: 11 additions & 21 deletions

File tree

backend/http/handler.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

backend/template/resources.gohtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
{{end}}
217217
</ul>
218218
<div class="card-body">
219-
<a href="{{if $.Cluster}}/clusters/{{$.Cluster}}{{end}}/bind?s={{$schema.SessionID}}&module={{$schema.Name}}" class="btn bind-btn {{$schema.Name}}">
219+
<a href="{{if $.Cluster}}/clusters/{{$.Cluster}}{{end}}/bind?s={{$schema.SessionID}}&template={{$schema.Name}}" class="btn bind-btn {{$schema.Name}}">
220220
Bind Module
221221
</a>
222222
</div>

contrib/kcp/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ kubectl apply -f contrib/kcp/deploy/examples/apiresourceschema-cowboys.yaml
9898
kubectl apply -f contrib/kcp/deploy/examples/apiresourceschema-sheriffs.yaml
9999
kubectl kcp bind apiexport root:provider:cowboys-stable
100100
# these are UI contract to enable listing in the UI to be nicer.
101-
kubectl apply -f contrib/kcp/deploy/examples/module-cowboys.yaml
102-
kubectl apply -f contrib/kcp/deploy/examples/module-sheriffs.yaml
101+
kubectl apply -f contrib/kcp/deploy/examples/template-cowboys.yaml
102+
kubectl apply -f contrib/kcp/deploy/examples/template-sheriffs.yaml
103103
kubectl apply -f contrib/kcp/deploy/examples/collection-wildwest.yaml
104104
```
105105

@@ -108,7 +108,7 @@ kubectl apply -f contrib/kcp/deploy/examples/collection-wildwest.yaml
108108
```bash
109109
kubectl get logicalcluster
110110
# NAME PHASE URL AGE
111-
# cluster Ready https://192.168.2.166:6443/clusters/1f4roigyt6meiaf8
111+
# cluster Ready https://192.168.2.166:6443/clusters/2cc89nxsuivawooq
112112
```
113113

114114
## Consumer
@@ -124,7 +124,7 @@ kubectl ws create consumer --enter
124124
10. Bind the thing:
125125

126126
```bash
127-
./bin/kubectl-bind http://127.0.0.1:8080/clusters/1f4roigyt6meiaf8/exports --dry-run -o yaml > apiserviceexport.yaml
127+
./bin/kubectl-bind http://127.0.0.1:8080/clusters/2cc89nxsuivawooq/exports --dry-run -o yaml > apiserviceexport.yaml
128128

129129
# Extract secret for binding process. Note that secret name is not the same as output from command above. Check secret
130130
# name by running `kubectl get secret -n kube-bind`

contrib/kcp/deploy/resources/apiexport-kube-bind.io.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ spec:
7272
schema: v250918-f26732b.boundschemas.kube-bind.io
7373
storage:
7474
crd: {}
75-
- group: catalog.kube-bind.io
76-
name: collections
77-
schema: v251016-4ed96ab.collections.catalog.kube-bind.io
78-
storage:
79-
crd: {}
80-
- group: catalog.kube-bind.io
81-
name: modules
82-
schema: v251017-d84f782.modules.catalog.kube-bind.io
83-
storage:
84-
crd: {}
8575
- group: kube-bind.io
8676
name: clusterbindings
8777
schema: v250925-56669b8.clusterbindings.kube-bind.io

0 commit comments

Comments
 (0)