Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NotInitializedError = errors.New("api cache hasn't yet been initialized")
NotInitializedError means the cache isn't yet ready to use.
Functions ¶
This section is empty.
Types ¶
type HostedAPICache ¶
type HostedAPICache interface { // Reader provides the basic Get/List functions for resources and abstracts // access to the underlying cache. client.Reader // Events will receive a GenericEvent whenever a relevant resource change // happens within the hosted apiserver. Events() <-chan event.GenericEvent }
HostedAPICache is used to provide read-only access to a hosted API server. The intent is for controllers (e.g. the hostedcontrolplane controller) to work with the cache instead of the apiserver directly when possible to avoid chatty queries or polling loops, and to provide a way for controllers to trigger reconciliation in response to events which happen in the hosted apiserver itself.
type HostedAPICacheReconciler ¶
HostedAPICacheReconciler is used to drive a hostedAPICache to keep the cache in sync with a hosted apiserver based on a kubeconfig published for the cluster.
The reconciler will watch for changes to the given kubeconfig secret and make the right calls to keep the hostedAPICache updated. Other controllers can use the GetCache function to get the actively managed HostedAPICache for accessing the hosted apiserver.
func RegisterHostedAPICacheReconciler ¶
func RegisterHostedAPICacheReconciler(mgr ctrl.Manager, cacheCtx context.Context, cacheLog logr.Logger, scope manifests.KubeconfigScope) (*HostedAPICacheReconciler, error)
RegisterHostedAPICacheReconciler builds a new HostedAPICacheReconciler for a cluster kubeconfig with the given scope.
func (*HostedAPICacheReconciler) GetCache ¶
func (r *HostedAPICacheReconciler) GetCache() HostedAPICache
GetCache provides a functional HostedAPICache which will stay in sync with the underlying kubeconfig secret used to make the cache.