Documentation ¶
Index ¶
- Constants
- func AddToManager(mgr manager.Manager) error
- func AddToManagerWithOptions(mgr manager.Manager, conf ControllerConfig) error
- func NewObjectIndex(references []resourcesv1alpha1.ObjectReference, withEquivalences Equivalences) *objectIndex
- func SecretToManagedResourceMapper(predicates ...predicate.Predicate) mapper.Mapper
- type ControllerConfig
- type ControllerOptions
- type EquivalenceSet
- type Equivalences
Constants ¶
const ControllerName = "resource"
ControllerName is the name of the managedresource controller.
Variables ¶
This section is empty.
Functions ¶
func AddToManager ¶
AddToManager adds the controller to a Manager using the default config.
func AddToManagerWithOptions ¶
func AddToManagerWithOptions(mgr manager.Manager, conf ControllerConfig) error
AddToManagerWithOptions adds the controller to a Manager with the given config.
func NewObjectIndex ¶
func NewObjectIndex(references []resourcesv1alpha1.ObjectReference, withEquivalences Equivalences) *objectIndex
NewObjectIndex constructs a new *objectIndex containing all the given ObjectReferences. It can optionally be configured to use a set of rules, defining what GroupKinds to consider equivalent when looking up references using `Lookup()`, by passing in an `Equivalences` object. If the `Equivalences` object is nil, then references are only considered as equivalent if their GroupKinds are equal.
Types ¶
type ControllerConfig ¶
type ControllerConfig struct { MaxConcurrentWorkers int SyncPeriod time.Duration ClassFilter *managerpredicate.ClassFilter AlwaysUpdate bool ClusterID string GarbageCollectorActivated bool TargetCluster cluster.Cluster // only used for testing, defaults to 5 seconds RequeueAfterOnDeletionPending time.Duration }
ControllerConfig is the completed configuration for the controller.
func (*ControllerConfig) ApplyDefaultClusterId ¶
func (c *ControllerConfig) ApplyDefaultClusterId(ctx context.Context, log logr.Logger, restcfg *rest.Config) error
ApplyDefaultClusterId sets the cluster id according to a dedicated cluster access
type ControllerOptions ¶
type ControllerOptions struct {
// contains filtered or unexported fields
}
ControllerOptions are options for adding the controller to a Manager.
func (*ControllerOptions) AddFlags ¶
func (o *ControllerOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds the needed command line flags to the given FlagSet.
func (*ControllerOptions) Complete ¶
func (o *ControllerOptions) Complete() error
Complete completes the given command line flags and set the defaultControllerConfig accordingly.
func (*ControllerOptions) Completed ¶
func (o *ControllerOptions) Completed() *ControllerConfig
Completed returns the completed ControllerConfig.
type EquivalenceSet ¶
EquivalenceSet is a set of GroupKinds which should be considered as equivalent representation of an Object Kind.
func (EquivalenceSet) Insert ¶
func (s EquivalenceSet) Insert(gks ...metav1.GroupKind) EquivalenceSet
Insert adds the given GroupKinds to the EquivalenceSet
type Equivalences ¶
type Equivalences map[metav1.GroupKind]EquivalenceSet
Equivalences is a set of EquivalenceSets, which can be used to look up equivalent GroupKinds for a given GroupKind.
func NewEquivalences ¶
func NewEquivalences(additionalEquivalences ...[]metav1.GroupKind) Equivalences
NewEquivalences constructs a new Equivalences object, which can be used to look up equivalent GroupKinds for a given GroupKind. It already has some default equivalences predefined (e.g. for Kind `Deployment` in Group `apps` and `extensions`). It can optionally take additional lists of GroupKinds which should be considered as equivalent representations of the respective Object Kinds.
func (Equivalences) GetEquivalencesFor ¶
func (e Equivalences) GetEquivalencesFor(gk metav1.GroupKind) EquivalenceSet
GetEquivalencesFor looks up which GroupKinds should be considered as equivalent to a given GroupKind.