Documentation
¶
Index ¶
- Constants
- func Eventf(eventtype, reason, messageFmt string, args ...interface{}) string
- func MakeFactory(ctor Ctor, logger *zap.SugaredLogger) 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 ToUnstructured(t *testing.T, objs []runtime.Object) (unstr []runtime.Object)
- func UnsetEnvVar(t *testing.T, name string) (reset func())
- type Ctor
- type FakeOwnerRefable
- type Listers
- func (l *Listers) GetEventingLister() sourceslistersv1alpha2.SinkBindingLister
- func (l *Listers) GetEventingObjects() []runtime.Object
- func (l *Listers) GetServiceLister() servinglistersv1.ServiceLister
- func (l *Listers) GetServingObjects() []runtime.Object
- func (l *Listers) GetSlackSourceLister() listersv1alpha1.SlackSourceLister
- func (l *Listers) GetSlackSourceObjects() []runtime.Object
- func (l *Listers) IndexerFor(obj runtime.Object) cache.Indexer
Constants ¶
const ( Namespace = "testns" Name = "test" Key = Namespace + "/" + Name UID = types.UID("00000000-0000-0000-0000-000000000000") Image = "registry/image:tag" )
Defaults for tests
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 ¶
func MakeFactory(ctor Ctor, logger *zap.SugaredLogger) rt.Factory
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 ToUnstructured ¶
ToUnstructured takes a list of k8s resources and converts them to Unstructured objects. We must pass objects as Unstructured to the dynamic client fake, or it won't handle them properly.
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 Ctor ¶
type Ctor func(context.Context, *Listers) controller.Reconciler
Ctor constructs a controller.Reconciler.
type FakeOwnerRefable ¶
type FakeOwnerRefable struct {
metav1.ObjectMeta
schema.GroupVersionKind
}
FakeOwnerRefable implements OwnerRefable.
func DummyOwnerRefable ¶
func DummyOwnerRefable() *FakeOwnerRefable
DummyOwnerRefable returns a OwnerRefable with dummy attributes.
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) GetEventingLister ¶
func (l *Listers) GetEventingLister() sourceslistersv1alpha2.SinkBindingLister
GetEventingLister returns a lister for Service objects.
func (*Listers) GetEventingObjects ¶
GetEventingObjects returns objects from the eventing API.
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) GetSlackSourceLister ¶
func (l *Listers) GetSlackSourceLister() listersv1alpha1.SlackSourceLister
GetSlackSourceLister returns a Lister for SlackSource objects.
func (*Listers) GetSlackSourceObjects ¶
GetSlackSourceObjects returns objects from the sources API.