Documentation
¶
Overview ¶
Package crdwatch watches a kind whose CRD may be missing, such as Traefik's IngressRoute: a controller can't start with a watch on a kind the API server doesn't serve, so the watch is added once it does.
Index ¶
Constants ¶
const DefaultInterval = 30 * time.Second
DefaultInterval is how often a missing CRD is looked for.
Variables ¶
This section is empty.
Functions ¶
func Installed ¶
func Installed(mapper meta.RESTMapper, gvk schema.GroupVersionKind) (bool, error)
Installed reports whether the API server serves gvk. A missing kind is false with no error; an error means it couldn't be told.
Types ¶
type Kind ¶
type Kind struct {
GVK schema.GroupVersionKind
Mapper meta.RESTMapper
Cache cache.Cache
// Interval between looks for the CRD; 0: DefaultInterval.
Interval time.Duration
// contains filtered or unexported fields
}
Kind adds watches on GVK to controllers once its CRD is installed. It is a leader-only manager runnable, like the controllers; Add every watch before the manager starts.
func (*Kind) Add ¶
func (k *Kind) Add(c controller.Controller, h handler.EventHandler, predicates ...predicate.Predicate)
Add watches GVK, as unstructured objects, for c once it is served.
func (*Kind) NeedLeaderElection ¶
NeedLeaderElection is true: the controllers it adds watches to run on the leader.