cache

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterAndNamespaceIndexFunc

func ClusterAndNamespaceIndexFunc(obj any) ([]string, error)

ClusterAndNamespaceIndexFunc indexes by cluster and namespace name.

func ClusterAndNamespaceIndexKey

func ClusterAndNamespaceIndexKey(clusterName logicalcluster.Name, namespace string) string

ClusterAndNamespaceIndexKey formats the index key for a cluster name and namespace.

func ClusterIndexFunc

func ClusterIndexFunc(obj any) ([]string, error)

ClusterIndexFunc indexes by cluster name.

func ClusterIndexKey

func ClusterIndexKey(clusterName logicalcluster.Name) string

ClusterIndexKey formats the index key for a cluster name.

Types

type ScopedCluster

type ScopedCluster struct {
	// contains filtered or unexported fields
}

ScopedCluster is a cluster that operates on a specific namespace.

func NewScopedCluster

func NewScopedCluster(cfg *rest.Config, clusterName logicalcluster.Name, wildcardCA WildcardCache, scheme *runtime.Scheme) (*ScopedCluster, error)

NewScopedCluster constructs a new cluster.Cluster that operates on a specific logical cluster.

func NewScopedInitializingCluster

func NewScopedInitializingCluster(cfg *rest.Config, clusterName logicalcluster.Name, wildcardCA WildcardCache, scheme *runtime.Scheme) (*ScopedCluster, error)

NewScopedInitializingCluster constructs a new cluster.Cluster that operates on a specific logical cluster for initializing workspaces. It doesn't construct client to read from wildcard cache.

func (*ScopedCluster) GetAPIReader

func (c *ScopedCluster) GetAPIReader() client.Reader

GetAPIReader returns a reader against the cluster.

func (*ScopedCluster) GetCache

func (c *ScopedCluster) GetCache() cache.Cache

GetCache returns a cache.Cache.

func (*ScopedCluster) GetClient

func (c *ScopedCluster) GetClient() client.Client

GetClient returns a client scoped to the namespace.

func (*ScopedCluster) GetConfig

func (c *ScopedCluster) GetConfig() *rest.Config

GetConfig returns the rest.Config scoped to the cluster.

func (*ScopedCluster) GetEventRecorderFor

func (c *ScopedCluster) GetEventRecorderFor(name string) record.EventRecorder

GetEventRecorderFor returns a new EventRecorder for the provided name.

func (*ScopedCluster) GetFieldIndexer

func (c *ScopedCluster) GetFieldIndexer() client.FieldIndexer

GetFieldIndexer returns a FieldIndexer scoped to the cluster.

func (*ScopedCluster) GetHTTPClient

func (c *ScopedCluster) GetHTTPClient() *http.Client

GetHTTPClient returns the HTTP client scoped to the cluster.

func (*ScopedCluster) GetRESTMapper

func (c *ScopedCluster) GetRESTMapper() meta.RESTMapper

GetRESTMapper returns a RESTMapper scoped to the cluster.

func (*ScopedCluster) GetScheme

func (c *ScopedCluster) GetScheme() *runtime.Scheme

GetScheme returns the scheme scoped to the cluster.

func (*ScopedCluster) Start

func (c *ScopedCluster) Start(ctx context.Context) error

Start starts the cluster.

type WildcardCache

type WildcardCache interface {
	cache.Cache
	GetSharedInformer(obj runtime.Object) (k8scache.SharedIndexInformer, schema.GroupVersionKind, apimeta.RESTScopeName, error)
}

WildcardCache is a cache that operates on a '/clusters/*' endpoint.

func NewWildcardCache

func NewWildcardCache(config *rest.Config, opts cache.Options) (WildcardCache, error)

NewWildcardCache returns a cache.Cache that handles multi-cluster watches against a /clusters/* endpoint. It wires SharedIndexInformers with additional indexes for cluster and cluster+namespace.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL