Documentation ¶
Index ¶
- func CreateResource(name string) *pkgtest.Resource
- func ExpectAllowed(t *testing.T, resp *admissionv1beta1.AdmissionResponse)
- func ExpectFailsWith(t *testing.T, resp *admissionv1beta1.AdmissionResponse, contains string)
- func ExpectPatches(t *testing.T, a []byte, e []jsonpatch.JsonPatchOperation)
- func MakeFactory(ctor Ctor) rtesting.Factory
- func NewScheme() *runtime.Scheme
- func ToUnstructured(t *testing.T, sch *runtime.Scheme, objs []runtime.Object) (us []runtime.Object)
- type Ctor
- type Listers
- func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister
- func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister
- func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister
- func (l *Listers) GetGatewayLister() istiolisters.GatewayLister
- 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) GetSharedObjects() []runtime.Object
- func (l *Listers) GetValidatingWebhookConfigurationLister() admissionlisters.ValidatingWebhookConfigurationLister
- func (l *Listers) GetVirtualServiceLister() istiolisters.VirtualServiceLister
- 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 *admissionv1beta1.AdmissionResponse)
ExpectAllowed checks that a given admission response allows the initiating request through.
func ExpectFailsWith ¶
func ExpectFailsWith(t *testing.T, resp *admissionv1beta1.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`.
func NewScheme ¶
NewScheme constructs a scheme from the set of client schemes supported by this package.
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.
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) GetConfigMapLister ¶
func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister
GetConfigMapLister gets lister for K8s ConfigMap resource.
func (*Listers) GetDeploymentLister ¶
func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister
GetDeploymentLister gets lister for K8s Deployment resource.
func (*Listers) GetEndpointsLister ¶
func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister
GetEndpointsLister gets lister for K8s Endpoints resource.
func (*Listers) GetGatewayLister ¶
func (l *Listers) GetGatewayLister() istiolisters.GatewayLister
GetGatewayLister gets lister for Istio Gateway 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) GetSharedObjects ¶
GetSharedObjects filters the Listers initial list of objects to types defined in knative/pkg
func (*Listers) GetValidatingWebhookConfigurationLister ¶
func (l *Listers) GetValidatingWebhookConfigurationLister() admissionlisters.ValidatingWebhookConfigurationLister
GetValidatingWebhookConfigurationLister gets lister for K8s ValidatingWebhookConfiguration resource.
func (*Listers) GetVirtualServiceLister ¶
func (l *Listers) GetVirtualServiceLister() istiolisters.VirtualServiceLister
GetVirtualServiceLister gets lister for Istio VirtualService resource.
func (*Listers) IndexerFor ¶
IndexerFor returns the indexer for the given object.