hostedapicache

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type HostedAPICacheReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

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

GetCache provides a functional HostedAPICache which will stay in sync with the underlying kubeconfig secret used to make the cache.

func (*HostedAPICacheReconciler) Reconcile

Jump to

Keyboard shortcuts

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