Documentation
¶
Index ¶
Constants ¶
const ( AnnotationKeyOriginalResourceVersion = "cache.kcp.io/original-resource-version" AnnotationKeyOriginalResourceUID = "cache.kcp.io/original-resource-UID" )
const (
// ControllerName hold this controller name.
ControllerName = "kcp-cluster-cached-resource-replication-controller"
)
Variables ¶
This section is empty.
Functions ¶
func InstallIndexers ¶
func InstallIndexers(replicated *ReplicatedGVR)
InstallIndexers adds the additional indexers that this controller requires to the informers.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( shardName string, localDynamicClusterClient kcpdynamic.ClusterInterface, globalDynamicClusterClient kcpdynamic.ClusterInterface, kcpCacheClient kcpclientset.ClusterInterface, cacheApiExtensionsClusterClient kcpapiextensionsclientset.ClusterInterface, cluster logicalcluster.Name, gvr schema.GroupVersionResource, replicated *ReplicatedGVR, requeueSelf func(), selection Selection, ) (*Controller, error)
NewController returns a new replication controller.
func (*Controller) SetDeleted ¶
func (c *Controller) SetDeleted(ctx context.Context)
func (*Controller) SetSelection ¶
func (c *Controller) SetSelection(selection Selection)
func (*Controller) Start ¶
func (c *Controller) Start(ctx context.Context, workers int)
Start starts the controller, which stops when ctx.Done() is closed.
func (*Controller) Started ¶
func (c *Controller) Started() bool
type ReplicatedGVR ¶
type ReplicatedGVR struct {
Kind string
Identity string
Filter func(u *unstructured.Unstructured) bool
Global, Local cache.SharedIndexInformer
}
type Selection ¶
Selection is what a ClusterCachedResource says it publishes: everything of its kind, or some subset picked out by labels, by name, or by both.
func SelectionFor ¶
func SelectionFor(clusterCachedResource *cachev1alpha1.ClusterCachedResource) Selection
SelectionFor reads the selection off a ClusterCachedResource. A resource that sets neither publishes its whole kind.
func (Selection) Filter ¶
func (s Selection) Filter(items []unstructured.Unstructured) []unstructured.Unstructured
Filter drops the objects a selection does not publish.
func (Selection) ListOptions ¶
func (s Selection) ListOptions() metav1.ListOptions
ListOptions returns the part of the selection the API server can apply for us. Names are left out on purpose -- a field selector only compares one value and a selection may name several -- so a caller that lists still has to run the results through Matches.