Documentation ¶
Index ¶
- func CreateResource(name string) *pkgtest.Resource
- func ExpectAllowed(t *testing.T, resp *admissionv1.AdmissionResponse)
- func ExpectFailsWith(t *testing.T, resp *admissionv1.AdmissionResponse, contains string)
- func ExpectPatches(t *testing.T, a []byte, e []jsonpatch.JsonPatchOperation)
- func MakeFactory(ctor Ctor) rtesting.Factory
- func NewScheme() *runtime.Scheme
- type Ctor
- type Listers
- func (l *Listers) GetAPIExtensionsObjects() []runtime.Object
- func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister
- func (l *Listers) GetCustomResourceDefinitionLister() apixlisters.CustomResourceDefinitionLister
- func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister
- func (l *Listers) GetDuckObjects() []runtime.Object
- func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister
- func (l *Listers) GetHorizontalPodAutoscalerLister() autoscalingv2beta1listers.HorizontalPodAutoscalerLister
- func (l *Listers) GetK8sServiceLister() corev1listers.ServiceLister
- func (l *Listers) GetKubeObjects() []runtime.Object
- func (l *Listers) GetMutatingWebhookConfigurationLister() admissionlisters.MutatingWebhookConfigurationLister
- func (l *Listers) GetNamespaceLister() corev1listers.NamespaceLister
- func (l *Listers) GetSecretLister() corev1listers.SecretLister
- func (l *Listers) GetTestObjects() []runtime.Object
- func (l *Listers) GetValidatingWebhookConfigurationLister() admissionlisters.ValidatingWebhookConfigurationLister
- func (l *Listers) IndexerFor(obj runtime.Object) cache.Indexer
- func (*Listers) NewScheme() *runtime.Scheme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResource ¶
CreateResource creates a testing.Resource with the given name in the system namespace.
func ExpectAllowed ¶
func ExpectAllowed(t *testing.T, resp *admissionv1.AdmissionResponse)
ExpectAllowed checks that a given admission response allows the initiating request through.
func ExpectFailsWith ¶
func ExpectFailsWith(t *testing.T, resp *admissionv1.AdmissionResponse, contains string)
ExpectFailsWith checks that a given admission response disallows the initiating request through and contains the provided string in its error message.
func ExpectPatches ¶
func ExpectPatches(t *testing.T, a []byte, e []jsonpatch.JsonPatchOperation)
ExpectPatches checks that the provided serialized bytes consist of an expected collection of patches. This is used to verify the mutations made in a mutating admission webhook's response.
func MakeFactory ¶
MakeFactory creates a reconciler factory with fake clients and controller created by `ctor`.
Types ¶
type Ctor ¶
type Ctor func(context.Context, *Listers, configmap.Watcher) controller.Reconciler
Ctor functions create a k8s controller with given params.
type Listers ¶
type Listers struct {
// contains filtered or unexported fields
}
Listers is used to synthesize informer-style Listers from fixed lists of resources in tests.
func NewListers ¶
NewListers constructs a Listers from a collection of objects.
func (*Listers) GetAPIExtensionsObjects ¶
GetAPIExtensionsObjects filters the Listers initial list of objects to types definite in k8s.io/apiextensions
func (*Listers) GetConfigMapLister ¶
func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister
GetConfigMapLister gets lister for K8s ConfigMap resource.
func (*Listers) GetCustomResourceDefinitionLister ¶
func (l *Listers) GetCustomResourceDefinitionLister() apixlisters.CustomResourceDefinitionLister
func (*Listers) GetDeploymentLister ¶
func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister
GetDeploymentLister gets lister for K8s Deployment resource.
func (*Listers) GetDuckObjects ¶
GetDuckObjects filters the Listers initial list of objects to types defined in knative/pkg
func (*Listers) GetEndpointsLister ¶
func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister
GetEndpointsLister gets lister for K8s Endpoints resource.
func (*Listers) GetHorizontalPodAutoscalerLister ¶
func (l *Listers) GetHorizontalPodAutoscalerLister() autoscalingv2beta1listers.HorizontalPodAutoscalerLister
GetHorizontalPodAutoscalerLister gets lister for HorizontalPodAutoscaler resources.
func (*Listers) GetK8sServiceLister ¶
func (l *Listers) GetK8sServiceLister() corev1listers.ServiceLister
GetK8sServiceLister gets lister for K8s Service resource.
func (*Listers) GetKubeObjects ¶
GetKubeObjects filters the Listers initial list of objects to built-in types
func (*Listers) GetMutatingWebhookConfigurationLister ¶
func (l *Listers) GetMutatingWebhookConfigurationLister() admissionlisters.MutatingWebhookConfigurationLister
GetMutatingWebhookConfigurationLister gets lister for K8s MutatingWebhookConfiguration resource.
func (*Listers) GetNamespaceLister ¶
func (l *Listers) GetNamespaceLister() corev1listers.NamespaceLister
GetNamespaceLister gets lister for Namespace resource.
func (*Listers) GetSecretLister ¶
func (l *Listers) GetSecretLister() corev1listers.SecretLister
GetSecretLister gets lister for K8s Secret resource.
func (*Listers) GetTestObjects ¶
GetTestObjects filters the Lister's initial list of objects to types defined in knative/pkg/testing
func (*Listers) GetValidatingWebhookConfigurationLister ¶
func (l *Listers) GetValidatingWebhookConfigurationLister() admissionlisters.ValidatingWebhookConfigurationLister
GetValidatingWebhookConfigurationLister gets lister for K8s ValidatingWebhookConfiguration resource.
func (*Listers) IndexerFor ¶
IndexerFor returns the indexer for the given object.