Documentation
¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) AddController(controller ManagedController) error
- func (c *Cluster) AddFeature(feature ClusterFeature)
- func (c *Cluster) AddOnAliveFunc(f ClusterFunc)
- func (c *Cluster) AddOnDeadFunc(f ClusterFunc)
- func (c *Cluster) GetClusterID() string
- func (c *Cluster) GetController(name string) ManagedController
- func (c *Cluster) GetControllerByGVK(gvk resources.GroupVersionKind) ManagedController
- func (c *Cluster) GetControllers() ManagedControllers
- func (c *Cluster) GetKubeconfig() []byte
- func (c *Cluster) GetManager() ctrl.Manager
- func (c *Cluster) GetName() string
- func (c *Cluster) GetPendingControllers() ManagedControllers
- func (c *Cluster) GetSecretID() *string
- func (c *Cluster) HasController(name string) bool
- func (c *Cluster) IsAlive() bool
- func (c *Cluster) IsManagerRunning() bool
- func (c *Cluster) ManagerStopped() <-chan struct{}
- func (c *Cluster) RemoveController(controller ManagedController)
- func (c *Cluster) RemoveControllerByName(name string)
- func (c *Cluster) RemoveFeature(uid string)
- func (c *Cluster) Start() error
- func (c *Cluster) StartManager() error
- func (c *Cluster) Stop()
- func (c *Cluster) StopManager()
- func (c *Cluster) Stopped() <-chan struct{}
- type ClusterFeature
- type ClusterFeatureRequirement
- type ClusterFunc
- type ManagedController
- type ManagedControllerOption
- type ManagedControllers
- type ManagedReconciler
- type ManagedReconcilerBase
- func (r *ManagedReconcilerBase) DoCleanup()
- func (r *ManagedReconcilerBase) GetClient() client.Client
- func (r *ManagedReconcilerBase) GetContext() context.Context
- func (r *ManagedReconcilerBase) GetLogger() logr.Logger
- func (r *ManagedReconcilerBase) GetManager() ctrl.Manager
- func (r *ManagedReconcilerBase) GetName() string
- func (r *ManagedReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ManagedReconcilerBase) PreCheck(ctx context.Context, client client.Client) error
- func (r *ManagedReconcilerBase) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ManagedReconcilerBase) SetClient(client client.Client)
- func (r *ManagedReconcilerBase) SetContext(ctx context.Context)
- func (r *ManagedReconcilerBase) SetLogger(l logr.Logger)
- func (r *ManagedReconcilerBase) SetManager(mgr ctrl.Manager)
- func (r *ManagedReconcilerBase) SetScheme(scheme *runtime.Scheme)
- func (r *ManagedReconcilerBase) SetupWithController(ctx context.Context, ctrl controller.Controller) error
- func (r *ManagedReconcilerBase) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- func (r *ManagedReconcilerBase) Start(ctx context.Context) error
- type Manager
- func (m *Manager) Add(cluster *Cluster) error
- func (m *Manager) AddOnAfterAddFunc(f func(c *Cluster), ids ...string)
- func (m *Manager) AddOnAfterDeleteFunc(f func(), ids ...string)
- func (m *Manager) AddOnBeforeAddFunc(f func(c *Cluster), ids ...string)
- func (m *Manager) AddOnBeforeDeleteFunc(f func(c *Cluster), ids ...string)
- func (m *Manager) DeleteOnAfterAddFunc(id string)
- func (m *Manager) DeleteOnAfterDeleteFunc(id string)
- func (m *Manager) DeleteOnBeforeAddFunc(id string)
- func (m *Manager) DeleteOnBeforeDeleteFunc(id string)
- func (m *Manager) Exists(name string) bool
- func (m *Manager) Get(name string) (*Cluster, error)
- func (m *Manager) GetAliveClustersByID() map[string]*Cluster
- func (m *Manager) GetAll() map[string]*Cluster
- func (m *Manager) Remove(cluster *Cluster) error
- func (m *Manager) Stopped() <-chan struct{}
- type ManagerOption
- type Option
- func WithCtrlOption(options ctrl.Options) Option
- func WithKubeconfig(kubeconfig []byte) Option
- func WithLivenessCheckInterval(interval time.Duration) Option
- func WithOnAliveFunc(f func(c *Cluster) error) Option
- func WithOnDeadFunc(f func(c *Cluster) error) Option
- func WithScheme(scheme *runtime.Scheme) Option
- func WithSecretID(secretID string) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClusterNotFound = errors.New("cluster not found") ErrControllerNotFound = errors.New("controller not found") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewCluster ¶
func (*Cluster) AddController ¶
func (c *Cluster) AddController(controller ManagedController) error
func (*Cluster) AddFeature ¶
func (c *Cluster) AddFeature(feature ClusterFeature)
func (*Cluster) AddOnAliveFunc ¶
func (c *Cluster) AddOnAliveFunc(f ClusterFunc)
func (*Cluster) AddOnDeadFunc ¶
func (c *Cluster) AddOnDeadFunc(f ClusterFunc)
func (*Cluster) GetClusterID ¶
func (*Cluster) GetController ¶
func (c *Cluster) GetController(name string) ManagedController
func (*Cluster) GetControllerByGVK ¶
func (c *Cluster) GetControllerByGVK(gvk resources.GroupVersionKind) ManagedController
func (*Cluster) GetControllers ¶
func (c *Cluster) GetControllers() ManagedControllers
func (*Cluster) GetKubeconfig ¶
func (*Cluster) GetManager ¶
func (*Cluster) GetPendingControllers ¶
func (c *Cluster) GetPendingControllers() ManagedControllers
func (*Cluster) GetSecretID ¶
func (*Cluster) HasController ¶
func (*Cluster) IsManagerRunning ¶
func (*Cluster) ManagerStopped ¶
func (c *Cluster) ManagerStopped() <-chan struct{}
func (*Cluster) RemoveController ¶
func (c *Cluster) RemoveController(controller ManagedController)
func (*Cluster) RemoveControllerByName ¶
func (*Cluster) RemoveFeature ¶
func (*Cluster) StartManager ¶
func (*Cluster) StopManager ¶
func (c *Cluster) StopManager()
type ClusterFeature ¶
func NewClusterFeature ¶
func NewClusterFeature(uid, name string, labels map[string]string) ClusterFeature
type ClusterFeatureRequirement ¶
type ClusterFeatureRequirement struct {
Name string
MatchLabels map[string]string
MatchExpressions []metav1.LabelSelectorRequirement
}
func (ClusterFeatureRequirement) Match ¶
func (r ClusterFeatureRequirement) Match(features map[string]ClusterFeature) bool
type ClusterFunc ¶
type ManagedController ¶
type ManagedController interface {
SetLogger(l logr.Logger)
GetReconciler() ManagedReconciler
GetName() string
Stop()
Stopped() <-chan struct{}
Start(ctx context.Context, mgr ctrl.Manager) error
GetRequiredClusterFeatures() []ClusterFeatureRequirement
GetClient() client.Client
}
func NewManagedController ¶
func NewManagedController(name string, r ManagedReconciler, l logr.Logger, options ...ManagedControllerOption) ManagedController
type ManagedControllerOption ¶
type ManagedControllerOption func(*managedController)
func WithRequiredClusterFeatures ¶
func WithRequiredClusterFeatures(features ...ClusterFeatureRequirement) ManagedControllerOption
type ManagedControllers ¶
type ManagedControllers map[string]ManagedController
type ManagedReconciler ¶
type ManagedReconciler interface {
reconcile.Reconciler
PreCheck(ctx context.Context, client client.Client) error
DoCleanup()
GetName() string
GetManager() ctrl.Manager
SetManager(mgr ctrl.Manager)
GetRecorder() record.EventRecorder
GetContext() context.Context
SetContext(ctx context.Context)
GetLogger() logr.Logger
SetLogger(l logr.Logger)
GetClient() client.Client
SetClient(client client.Client)
Start(ctx context.Context) error
SetScheme(scheme *runtime.Scheme)
SetupWithController(ctx context.Context, ctrl controller.Controller) error
SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
}
func NewManagedReconciler ¶
func NewManagedReconciler(name string, log logr.Logger) ManagedReconciler
type ManagedReconcilerBase ¶
type ManagedReconcilerBase struct {
// contains filtered or unexported fields
}
func (*ManagedReconcilerBase) DoCleanup ¶
func (r *ManagedReconcilerBase) DoCleanup()
func (*ManagedReconcilerBase) GetClient ¶
func (r *ManagedReconcilerBase) GetClient() client.Client
func (*ManagedReconcilerBase) GetContext ¶
func (r *ManagedReconcilerBase) GetContext() context.Context
func (*ManagedReconcilerBase) GetLogger ¶
func (r *ManagedReconcilerBase) GetLogger() logr.Logger
func (*ManagedReconcilerBase) GetManager ¶
func (r *ManagedReconcilerBase) GetManager() ctrl.Manager
func (*ManagedReconcilerBase) GetName ¶
func (r *ManagedReconcilerBase) GetName() string
func (*ManagedReconcilerBase) GetRecorder ¶
func (r *ManagedReconcilerBase) GetRecorder() record.EventRecorder
func (*ManagedReconcilerBase) SetClient ¶
func (r *ManagedReconcilerBase) SetClient(client client.Client)
func (*ManagedReconcilerBase) SetContext ¶
func (r *ManagedReconcilerBase) SetContext(ctx context.Context)
func (*ManagedReconcilerBase) SetLogger ¶
func (r *ManagedReconcilerBase) SetLogger(l logr.Logger)
func (*ManagedReconcilerBase) SetManager ¶
func (r *ManagedReconcilerBase) SetManager(mgr ctrl.Manager)
func (*ManagedReconcilerBase) SetScheme ¶
func (r *ManagedReconcilerBase) SetScheme(scheme *runtime.Scheme)
func (*ManagedReconcilerBase) SetupWithController ¶
func (r *ManagedReconcilerBase) SetupWithController(ctx context.Context, ctrl controller.Controller) error
func (*ManagedReconcilerBase) SetupWithManager ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(ctx context.Context, options ...ManagerOption) *Manager
func (*Manager) AddOnAfterAddFunc ¶
func (*Manager) AddOnAfterDeleteFunc ¶
func (*Manager) AddOnBeforeAddFunc ¶
func (*Manager) AddOnBeforeDeleteFunc ¶
func (*Manager) DeleteOnAfterAddFunc ¶
func (*Manager) DeleteOnAfterDeleteFunc ¶
func (*Manager) DeleteOnBeforeAddFunc ¶
func (*Manager) DeleteOnBeforeDeleteFunc ¶
func (*Manager) GetAliveClustersByID ¶
type ManagerOption ¶
type ManagerOption func(m *Manager)
func WithOnAfterAddFunc ¶
func WithOnAfterAddFunc(f func(c *Cluster), ids ...string) ManagerOption
func WithOnAfterDeleteFunc ¶
func WithOnAfterDeleteFunc(f func(), ids ...string) ManagerOption
func WithOnBeforeAddFunc ¶
func WithOnBeforeAddFunc(f func(c *Cluster), ids ...string) ManagerOption
func WithOnBeforeDeleteFunc ¶
func WithOnBeforeDeleteFunc(f func(c *Cluster), ids ...string) ManagerOption
type Option ¶
type Option func(*Cluster)
func WithCtrlOption ¶
func WithKubeconfig ¶
func WithOnAliveFunc ¶
func WithOnDeadFunc ¶
func WithScheme ¶
func WithSecretID ¶
Click to show internal directories.
Click to hide internal directories.