Documentation ¶
Index ¶
- type Expectations
- type Lister
- type Tracker
- func (t *Tracker) CancelData(gvk schema.GroupVersionKind)
- func (t *Tracker) CancelTemplate(ct *templates.ConstraintTemplate)
- func (t *Tracker) CheckSatisfied(_ *http.Request) error
- func (t *Tracker) DisableStats()
- func (t *Tracker) EnableStats()
- func (t *Tracker) For(gvk schema.GroupVersionKind) Expectations
- func (t *Tracker) ForData(gvk schema.GroupVersionKind) Expectations
- func (t *Tracker) Populated() bool
- func (t *Tracker) Run(ctx context.Context) error
- func (t *Tracker) Satisfied() bool
- func (t *Tracker) TryCancelTemplate(ct *templates.ConstraintTemplate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expectations ¶
type Expectations interface { Expect(o runtime.Object) CancelExpect(o runtime.Object) TryCancelExpect(o runtime.Object) bool ExpectationsDone() Observe(o runtime.Object) Satisfied() bool Populated() bool }
Expectations tracks expectations for runtime.Objects. A set of Expect() calls are made, demarcated by ExpectationsDone(). Expectations are satisfied by calls to Observe(). Once all expectations are satisfied, Satisfied() will begin returning true.
type Lister ¶
type Lister interface {
List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
}
Lister lists resources from a cache.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks readiness for templates, constraints and data.
func NewTracker ¶
func NewTracker(lister Lister, mutationEnabled, externalDataEnabled, expansionEnabled bool) *Tracker
NewTracker creates a new Tracker and initializes the internal trackers.
func SetupTracker ¶
func SetupTracker(mgr manager.Manager, mutationEnabled, externalDataEnabled, expansionEnabled bool) (*Tracker, error)
SetupTracker sets up a readiness tracker and registers it to run under control of the provided Manager object. NOTE: Must be called _before_ the manager is started.
func SetupTrackerNoReadyz ¶
func SetupTrackerNoReadyz(mgr manager.Manager, mutationEnabled, externalDataEnabled, expansionEnabled bool) (*Tracker, error)
SetupTrackerNoReadyz sets up a readiness tracker and registers it to run under control of the provided Manager object without instantiating /readyz (used for testing).
func (*Tracker) CancelData ¶
func (t *Tracker) CancelData(gvk schema.GroupVersionKind)
CancelData stops expecting data for the specified resource kind.
func (*Tracker) CancelTemplate ¶
func (t *Tracker) CancelTemplate(ct *templates.ConstraintTemplate)
CancelTemplate stops expecting the provided ConstraintTemplate and associated Constraints.
func (*Tracker) CheckSatisfied ¶
CheckSatisfied implements healthz.Checker to report readiness based on tracker status. Returns nil if all expectations have been satisfied, otherwise returns an error.
func (*Tracker) DisableStats ¶
func (t *Tracker) DisableStats()
DisableStats disables the verbose logging routine for the readiness tracker.
func (*Tracker) EnableStats ¶
func (t *Tracker) EnableStats()
EnableStats enables the verbose logging routine for the readiness tracker.
func (*Tracker) For ¶
func (t *Tracker) For(gvk schema.GroupVersionKind) Expectations
For returns Expectations for the requested resource kind.
func (*Tracker) ForData ¶
func (t *Tracker) ForData(gvk schema.GroupVersionKind) Expectations
ForData returns Expectations for tracking data of the requested resource kind.
func (*Tracker) Run ¶
Run runs the tracker and blocks until it completes. The provided context can be canceled to signal a shutdown request.
func (*Tracker) TryCancelTemplate ¶
func (t *Tracker) TryCancelTemplate(ct *templates.ConstraintTemplate)
TryCancelTemplate will check the readiness retries left on a CT and cancel the expectation for that CT and its associated Constraints if no retries remain.