Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrResourceError is raised when this is used with an unsupported resource // kind. ErrResourceError = errors.New("unable to assert resource type") )
Functions ¶
Types ¶
type ControllerFactory ¶
type ControllerFactory interface { // Metadata returns the application, version and revision. Metadata() (string, string, string) // Options may be nil, otherwise it's a controller specific set of // options that are added to the flagset on start up and passed to the // reonciler. Options() ControllerOptions // Reconciler returns a new reconciler instance. Reconciler(options *options.Options, controllerOptions ControllerOptions, manager manager.Manager) reconcile.Reconciler // RegisterWatches adds any watches that would trigger a reconcile. RegisterWatches(manager manager.Manager, controller controller.Controller) error // Upgrade allows version based upgrades of managed resources. // DO NOT MODIFY THE SPEC EVER. Only things like metadata can // be touched. Upgrade(client client.Client) error // Schemes allows controllers to add types to the client beyond // the defaults defined in this repository. Schemes() []coreclient.SchemeAdder }
ControllerFactory allows creation of a Unikorn controller with minimal code.
type ControllerOptions ¶ added in v0.1.65
type ControllerOptions interface { // AddFlags adds a set of flags to the flagset. AddFlags(f *pflag.FlagSet) }
ControllerOptions abstracts controller specific flags.
type ProvisionerCreateFunc ¶
type ProvisionerCreateFunc func(ControllerOptions) provisioners.ManagerProvisioner
ProvisionerCreateFunc provides a type agnosic method to create a root provisioner.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler is a generic reconciler for all manager types.
func NewReconciler ¶
func NewReconciler(options *options.Options, controllerOptions ControllerOptions, manager manager.Manager, createProvisioner ProvisionerCreateFunc) *Reconciler
NewReconciler creates a new reconciler.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile is the top-level reconcile interface that controller-runtime will dispatch to. It initialises the provisioner, extracts the request object and based on whether it exists or not, reconciles or deletes the object respectively.
Click to show internal directories.
Click to hide internal directories.