v1alpha4

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromClusterHandlerToHandler added in v1.1.0

func FromClusterHandlerToHandler(sync ClusterHandler) generic.Handler

func FromMachineHandlerToHandler

func FromMachineHandlerToHandler(sync MachineHandler) generic.Handler

func RegisterClusterGeneratingHandler added in v1.1.0

func RegisterClusterGeneratingHandler(ctx context.Context, controller ClusterController, apply apply.Apply,
	condition condition.Cond, name string, handler ClusterGeneratingHandler, opts *generic.GeneratingHandlerOptions)

RegisterClusterGeneratingHandler configures a ClusterController to execute a ClusterGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterClusterStatusHandler added in v1.1.0

func RegisterClusterStatusHandler(ctx context.Context, controller ClusterController, condition condition.Cond, name string, handler ClusterStatusHandler)

RegisterClusterStatusHandler configures a ClusterController to execute a ClusterStatusHandler for every events observed. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterMachineGeneratingHandler

func RegisterMachineGeneratingHandler(ctx context.Context, controller MachineController, apply apply.Apply,
	condition condition.Cond, name string, handler MachineGeneratingHandler, opts *generic.GeneratingHandlerOptions)

RegisterMachineGeneratingHandler configures a MachineController to execute a MachineGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterMachineStatusHandler

func RegisterMachineStatusHandler(ctx context.Context, controller MachineController, condition condition.Cond, name string, handler MachineStatusHandler)

RegisterMachineStatusHandler configures a MachineController to execute a MachineStatusHandler for every events observed. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func UpdateClusterDeepCopyOnChange added in v1.1.0

func UpdateClusterDeepCopyOnChange(client ClusterClient, obj *v1alpha4.Cluster, handler func(obj *v1alpha4.Cluster) (*v1alpha4.Cluster, error)) (*v1alpha4.Cluster, error)

func UpdateMachineDeepCopyOnChange

func UpdateMachineDeepCopyOnChange(client MachineClient, obj *v1alpha4.Machine, handler func(obj *v1alpha4.Machine) (*v1alpha4.Machine, error)) (*v1alpha4.Machine, error)

Types

type ClusterCache added in v1.1.0

type ClusterCache interface {
	Get(namespace, name string) (*v1alpha4.Cluster, error)
	List(namespace string, selector labels.Selector) ([]*v1alpha4.Cluster, error)

	AddIndexer(indexName string, indexer ClusterIndexer)
	GetByIndex(indexName, key string) ([]*v1alpha4.Cluster, error)
}

type ClusterClient added in v1.1.0

type ClusterClient interface {
	Create(*v1alpha4.Cluster) (*v1alpha4.Cluster, error)
	Update(*v1alpha4.Cluster) (*v1alpha4.Cluster, error)
	UpdateStatus(*v1alpha4.Cluster) (*v1alpha4.Cluster, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1alpha4.Cluster, error)
	List(namespace string, opts metav1.ListOptions) (*v1alpha4.ClusterList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha4.Cluster, err error)
}

type ClusterController added in v1.1.0

type ClusterController interface {
	generic.ControllerMeta
	ClusterClient

	OnChange(ctx context.Context, name string, sync ClusterHandler)
	OnRemove(ctx context.Context, name string, sync ClusterHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() ClusterCache
}

func NewClusterController added in v1.1.0

func NewClusterController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) ClusterController

type ClusterGeneratingHandler added in v1.1.0

type ClusterGeneratingHandler func(obj *v1alpha4.Cluster, status v1alpha4.ClusterStatus) ([]runtime.Object, v1alpha4.ClusterStatus, error)

ClusterGeneratingHandler is the top-level handler that is executed for every Cluster event. It extends ClusterStatusHandler by a returning a slice of child objects to be passed to apply.Apply

type ClusterHandler added in v1.1.0

type ClusterHandler func(string, *v1alpha4.Cluster) (*v1alpha4.Cluster, error)

type ClusterIndexer added in v1.1.0

type ClusterIndexer func(obj *v1alpha4.Cluster) ([]string, error)

type ClusterStatusHandler added in v1.1.0

type ClusterStatusHandler func(obj *v1alpha4.Cluster, status v1alpha4.ClusterStatus) (v1alpha4.ClusterStatus, error)

ClusterStatusHandler is executed for every added or modified Cluster. Should return the new status to be updated

type Interface

type Interface interface {
	Cluster() ClusterController
	Machine() MachineController
}

func New

func New(controllerFactory controller.SharedControllerFactory) Interface

type MachineCache

type MachineCache interface {
	Get(namespace, name string) (*v1alpha4.Machine, error)
	List(namespace string, selector labels.Selector) ([]*v1alpha4.Machine, error)

	AddIndexer(indexName string, indexer MachineIndexer)
	GetByIndex(indexName, key string) ([]*v1alpha4.Machine, error)
}

type MachineClient

type MachineClient interface {
	Create(*v1alpha4.Machine) (*v1alpha4.Machine, error)
	Update(*v1alpha4.Machine) (*v1alpha4.Machine, error)
	UpdateStatus(*v1alpha4.Machine) (*v1alpha4.Machine, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1alpha4.Machine, error)
	List(namespace string, opts metav1.ListOptions) (*v1alpha4.MachineList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha4.Machine, err error)
}

type MachineController

type MachineController interface {
	generic.ControllerMeta
	MachineClient

	OnChange(ctx context.Context, name string, sync MachineHandler)
	OnRemove(ctx context.Context, name string, sync MachineHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() MachineCache
}

func NewMachineController

func NewMachineController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) MachineController

type MachineGeneratingHandler

type MachineGeneratingHandler func(obj *v1alpha4.Machine, status v1alpha4.MachineStatus) ([]runtime.Object, v1alpha4.MachineStatus, error)

MachineGeneratingHandler is the top-level handler that is executed for every Machine event. It extends MachineStatusHandler by a returning a slice of child objects to be passed to apply.Apply

type MachineHandler

type MachineHandler func(string, *v1alpha4.Machine) (*v1alpha4.Machine, error)

type MachineIndexer

type MachineIndexer func(obj *v1alpha4.Machine) ([]string, error)

type MachineStatusHandler

type MachineStatusHandler func(obj *v1alpha4.Machine, status v1alpha4.MachineStatus) (v1alpha4.MachineStatus, error)

MachineStatusHandler is executed for every added or modified Machine. Should return the new status to be updated

Jump to

Keyboard shortcuts

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