Documentation

Overview

    Package builder provides wraps other controller-runtime libraries and exposes simple patterns for building common Controllers.

    Projects built with the builder package can trivially be rebased on top of the underlying packages if the project requires more customized behavior in the future.

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Builder

    type Builder struct {
    	// contains filtered or unexported fields
    }

      Builder builds a Controller.

      Example

        This example creates a simple application ControllerManagedBy that is configured for ReplicaSets and Pods.

        * Create a new application for ReplicaSets that manages Pods owned by the ReplicaSet and calls into ReplicaSetReconciler.

        * Start the application.

        Output:
        
        

        func ControllerManagedBy

        func ControllerManagedBy(m manager.Manager) *Builder

          ControllerManagedBy returns a new controller builder that will be started by the provided Manager

          func SimpleController

          func SimpleController() *Builder

            SimpleController returns a new Builder. Deprecated: Use ControllerManagedBy(Manager) instead.

            func (*Builder) Build

            func (blder *Builder) Build(r reconcile.Reconciler) (manager.Manager, error)

              Build builds the Application ControllerManagedBy and returns the Manager used to start it. Deprecated: Use Complete

              func (*Builder) Complete

              func (blder *Builder) Complete(r reconcile.Reconciler) error

                Complete builds the Application ControllerManagedBy and returns the Manager used to start it.

                func (*Builder) For

                func (blder *Builder) For(apiType runtime.Object) *Builder

                  For defines the type of Object being *reconciled*, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object*. This is the equivalent of calling Watches(&source.Kind{Type: apiType}, &handler.EnqueueRequestForObject{})

                  func (*Builder) ForType

                  func (blder *Builder) ForType(apiType runtime.Object) *Builder

                    ForType defines the type of Object being *reconciled*, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object*. This is the equivalent of calling Watches(&source.Kind{Type: apiType}, &handler.EnqueueRequestForObject{}) Deprecated: Use For

                    func (*Builder) Owns

                    func (blder *Builder) Owns(apiType runtime.Object) *Builder

                      Owns defines types of Objects being *generated* by the ControllerManagedBy, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the owner object*. This is the equivalent of calling Watches(&handler.EnqueueRequestForOwner{&source.Kind{Type: <ForType-apiType>}, &handler.EnqueueRequestForOwner{OwnerType: apiType, IsController: true})

                      func (*Builder) Watches

                      func (blder *Builder) Watches(src source.Source, eventhandler handler.EventHandler) *Builder

                        Watches exposes the lower-level ControllerManagedBy Watches functions through the builder. Consider using Owns or For instead of Watches directly.

                        func (*Builder) WithConfig

                        func (blder *Builder) WithConfig(config *rest.Config) *Builder

                          WithConfig sets the Config to use for configuring clients. Defaults to the in-cluster config or to ~/.kube/config. Deprecated: Use ControllerManagedBy(Manager) and this isn't needed.

                          func (*Builder) WithEventFilter

                          func (blder *Builder) WithEventFilter(p predicate.Predicate) *Builder

                            WithEventFilter sets the event filters, to filter which create/update/delete/generic events eventually trigger reconciliations. For example, filtering on whether the resource version has changed. Defaults to the empty list.

                            func (*Builder) WithManager

                            func (blder *Builder) WithManager(m manager.Manager) *Builder

                              WithManager sets the Manager to use for registering the ControllerManagedBy. Defaults to a new manager.Manager. Deprecated: Use ControllerManagedBy(Manager) and this isn't needed.

                              Source Files