Documentation
¶
Overview ¶
Package shared provides utilities shared across kcp controllers.
Index ¶
Constants ¶
const AnnotationOwnerBinding = "apibindingtemplate.kube-bind.io/owner-binding"
AnnotationOwnerBinding is the annotation key used to link an APIServiceExportTemplate back to the APIBinding that owns it.
Variables ¶
This section is empty.
Functions ¶
func ExtractClusterID ¶
ExtractClusterID extracts the cluster ID from an apiexport virtual workspace URL. The expected URL format (as of kcp v0.26+) is:
https://host:port/services/apiexport/<path>/<apiexport-name>/clusters/<cluster-id>
where path segments 0-3 are /services/apiexport/<workspace-path>/<export>, segment 4 is "clusters", and segment 5 is the cluster ID.
func SchemaGetterWithFallback ¶
func SchemaGetterWithFallback( workspaceClient client.Client, clusterConfig *rest.Config, vwCache *VWClientCache, ) func(ctx context.Context, name string) (*apisv1alpha1.APIResourceSchema, error)
SchemaGetterWithFallback returns a function that first tries to get an APIResourceSchema from the workspace client, and if not found, falls back to the apiresourceschema virtual workspace via the cached VW client.
Types ¶
type VWClientCache ¶
type VWClientCache struct {
// contains filtered or unexported fields
}
VWClientCache caches controller-runtime clients keyed by cluster ID to avoid creating a new client on every schema lookup.
func NewVWClientCache ¶
func NewVWClientCache(baseConfig *rest.Config, scheme *runtime.Scheme) *VWClientCache
NewVWClientCache creates a new VWClientCache.