File tree Expand file tree Collapse file tree
backend/provider/kcp/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ import (
3737)
3838
3939// templateNameForBinding derives a deterministic APIServiceExportTemplate name
40- // from the APIBinding name and scope.
40+ // from the APIBinding name and scope. The naming convention is:
41+ //
42+ // <bindingName>-cluster for ClusterScope
43+ // <bindingName>-namespaced for NamespacedScope
44+ //
45+ // Note: if a binding name already ends in "-cluster" or "-namespaced", this
46+ // could theoretically collide with another binding's template name. In practice
47+ // kcp APIBinding names are generated and unlikely to hit this edge case.
4148func templateNameForBinding (bindingName string , scope kubebindv1alpha2.InformerScope ) string {
4249 switch scope {
4350 case kubebindv1alpha2 .ClusterScope :
Original file line number Diff line number Diff line change @@ -37,8 +37,12 @@ import (
3737const AnnotationOwnerBinding = "apibindingtemplate.kube-bind.io/owner-binding"
3838
3939// ExtractClusterID extracts the cluster ID from an apiexport virtual workspace
40- // URL. The URL format is:
41- // https://host:port/services/apiexport/root:org:ws/<apiexport-name>/clusters/{cluster-id}
40+ // URL. The expected URL format (as of kcp v0.26+) is:
41+ //
42+ // https://host:port/services/apiexport/<path>/<apiexport-name>/clusters/<cluster-id>
43+ //
44+ // where path segments 0-3 are /services/apiexport/<workspace-path>/<export>,
45+ // segment 4 is "clusters", and segment 5 is the cluster ID.
4246func ExtractClusterID (clusterConfig * rest.Config ) (string , error ) {
4347 u , err := url .Parse (clusterConfig .Host )
4448 if err != nil {
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ The provider workspace owns the `cowboys` `APIResourceSchema` and `APIExport`.
5757
58582 . Set up the provider workspace:
5959
60- cp ../../kcp-dev/kcp/.kcp/admin.kubeconfig .kcp/admin.kubeconfig
6160
6261``` bash
6362cp .kcp/admin.kubeconfig .kcp/provider.kubeconfig
You can’t perform that action at this time.
0 commit comments