Documentation
¶
Overview ¶
Package testing contains test helpers for reconcilers.
Index ¶
- func Eventf(eventtype, reason, messageFmt string, args ...interface{}) string
- func MakeFactory(ctor Ctor) rt.Factory
- func NewConfigMap(name string, data map[string]string) *corev1.ConfigMap
- func NewScheme() *runtime.Scheme
- func SetEnvVar(t *testing.T, name, val string) (unset func())
- func TestControllerConstructor(t *testing.T, ctor injection.ControllerConstructor, ...)
- func TestControllerConstructorFailures(t *testing.T, ctor injection.ControllerConstructor)
- func UnsetEnvVar(t *testing.T, name string) (unset func())
- type ControllerTestOptions
- type Ctor
- type FakeOwnerRefable
- type Listers
- func (l *Listers) GetAlibabaOSSTargetLister() targetslisters.AlibabaOSSTargetLister
- func (l *Listers) GetAlibabaOSSTargetsObjects() []runtime.Object
- func (l *Listers) GetGoogleSheetTargetLister() targetslisters.GoogleSheetTargetLister
- func (l *Listers) GetGoogleSheetTargetsObjects() []runtime.Object
- func (l *Listers) GetHTTPTargetLister() targetslisters.HTTPTargetLister
- func (l *Listers) GetHTTPTargetsObjects() []runtime.Object
- func (l *Listers) GetHasuraTargetLister() targetslisters.HasuraTargetLister
- func (l *Listers) GetHasuraTargetsObjects() []runtime.Object
- func (l *Listers) GetInfraTargetLister() targetslisters.InfraTargetLister
- func (l *Listers) GetJiraTargetLister() targetslisters.JiraTargetLister
- func (l *Listers) GetKubeObjects() []runtime.Object
- func (l *Listers) GetLogzTargetLister() targetslisters.LogzTargetLister
- func (l *Listers) GetLogzTargetObjects() []runtime.Object
- func (l *Listers) GetSalesforceTargetLister() targetslisters.SalesforceTargetLister
- func (l *Listers) GetServiceLister() servinglistersv1.ServiceLister
- func (l *Listers) GetServingObjects() []runtime.Object
- func (l *Listers) GetSplunkTargetLister() targetslisters.SplunkTargetLister
- func (l *Listers) GetSplunkTargetsObjects() []runtime.Object
- func (l *Listers) IndexerFor(obj runtime.Object) cache.Indexer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eventf ¶
Eventf returns the attributes of an API event in the format returned by Kubernetes' FakeRecorder.
func MakeFactory ¶
MakeFactory creates a testing factory for our controller.Reconciler, and initializes a Reconciler using the given Ctor as part of the process.
func NewConfigMap ¶
NewConfigMap returns a ConfigMap object.
func NewScheme ¶
NewScheme returns a new scheme populated with the types defined in clientSetSchemes.
func SetEnvVar ¶
SetEnvVar sets the value of an env var and returns a function that can be deferred to unset that variable.
func TestControllerConstructor ¶
func TestControllerConstructor(t *testing.T, ctor injection.ControllerConstructor, opts ...ControllerTestOptions)
TestControllerConstructor tests that a controller constructor meets our requirements.
func TestControllerConstructorFailures ¶
func TestControllerConstructorFailures(t *testing.T, ctor injection.ControllerConstructor)
TestControllerConstructorFailures tests that a controller constructor fails when various requirements are not met.
func UnsetEnvVar ¶
UnsetEnvVar unsets the value of an env var and returns a function that can be deferred to reset that variable to its original value.
Types ¶
type ControllerTestOptions ¶
type ControllerTestOptions func(*constructorTestConfig)
ControllerTestOptions is a functional option for a constructorTestConfig.
func WithInformerNumber ¶
func WithInformerNumber(n int) ControllerTestOptions
WithInformerNumber sets the number of expected informers for the test
type Ctor ¶
type Ctor func(*testing.T, context.Context, *Listers) controller.Reconciler
Ctor constructs a controller.Reconciler.
type FakeOwnerRefable ¶
type FakeOwnerRefable struct { metav1.ObjectMeta schema.GroupVersionKind }
FakeOwnerRefable implements OwnerRefable.
func NewOwnerRefable ¶
func NewOwnerRefable(name string, gvk schema.GroupVersionKind, uid types.UID) *FakeOwnerRefable
NewOwnerRefable returns a OwnerRefable with the given attributes.
func (*FakeOwnerRefable) GetGroupVersionKind ¶
func (o *FakeOwnerRefable) GetGroupVersionKind() schema.GroupVersionKind
GetGroupVersionKind returns the GroupVersionKind from the object.
type Listers ¶
type Listers struct {
// contains filtered or unexported fields
}
Listers returns listers and objects filtered from those listers.
func NewListers ¶
NewListers returns a new instance of Listers initialized with the given objects.
func (*Listers) GetAlibabaOSSTargetLister ¶
func (l *Listers) GetAlibabaOSSTargetLister() targetslisters.AlibabaOSSTargetLister
GetAlibabaOSSTargetLister returns a Lister for GoogleSheetTarget objects.
func (*Listers) GetAlibabaOSSTargetsObjects ¶
GetAlibabaOSSTargetsObjects returns objects from the targets API.
func (*Listers) GetGoogleSheetTargetLister ¶
func (l *Listers) GetGoogleSheetTargetLister() targetslisters.GoogleSheetTargetLister
GetGoogleSheetTargetLister returns a Lister for GoogleSheetTarget objects.
func (*Listers) GetGoogleSheetTargetsObjects ¶
GetGoogleSheetTargetsObjects returns objects from the targets API.
func (*Listers) GetHTTPTargetLister ¶
func (l *Listers) GetHTTPTargetLister() targetslisters.HTTPTargetLister
GetHTTPTargetLister returns a Lister for HTTPTarget objects.
func (*Listers) GetHTTPTargetsObjects ¶
GetHTTPTargetsObjects returns objects from the targets API.
func (*Listers) GetHasuraTargetLister ¶
func (l *Listers) GetHasuraTargetLister() targetslisters.HasuraTargetLister
GetHasuraTargetLister returns a Lister for HasuraTarget objects.
func (*Listers) GetHasuraTargetsObjects ¶
GetHasuraTargetsObjects returns objects from the targets API.
func (*Listers) GetInfraTargetLister ¶
func (l *Listers) GetInfraTargetLister() targetslisters.InfraTargetLister
GetInfraTargetLister returns a Lister for InfraTarget objects.
func (*Listers) GetJiraTargetLister ¶
func (l *Listers) GetJiraTargetLister() targetslisters.JiraTargetLister
GetJiraTargetLister returns a Lister for JiraTarget objects.
func (*Listers) GetKubeObjects ¶
GetKubeObjects returns objects from Kubernetes APIs.
func (*Listers) GetLogzTargetLister ¶
func (l *Listers) GetLogzTargetLister() targetslisters.LogzTargetLister
GetLogzTargetLister returns a Lister for LogzTarget objects.
func (*Listers) GetLogzTargetObjects ¶
GetLogzTargetObjects returns objects from Kubernetes APIs.
func (*Listers) GetSalesforceTargetLister ¶
func (l *Listers) GetSalesforceTargetLister() targetslisters.SalesforceTargetLister
GetSalesforceTargetLister returns a Lister for SalesforceTarget objects.
func (*Listers) GetServiceLister ¶
func (l *Listers) GetServiceLister() servinglistersv1.ServiceLister
GetServiceLister returns a lister for Service objects.
func (*Listers) GetServingObjects ¶
GetServingObjects returns objects from the serving API.
func (*Listers) GetSplunkTargetLister ¶
func (l *Listers) GetSplunkTargetLister() targetslisters.SplunkTargetLister
GetSplunkTargetLister returns a Lister for SplunkTarget objects.
func (*Listers) GetSplunkTargetsObjects ¶
GetSplunkTargetsObjects returns objects from the targets API.