func gvr(group, version, resource string) schema.GroupVersionResource { … } func gvk(group, version, kind string) schema.GroupVersionKind { … } var _ … type fakeMatcher … func (f *fakeMatcher) Match(ctx context.Context, versionedAttr *admission.VersionedAttributes, versionedParams runtime.Object, authz authorizer.Authorizer) matchconditions.MatchResult { … } var _ … type fakeWebhookAccessor … func (f *fakeWebhookAccessor) GetCompiledMatcher(compiler cel.FilterCompiler) matchconditions.Matcher { … } var _ … type fakeVersionedAttributeAccessor … func (v *fakeVersionedAttributeAccessor) VersionedAttribute(gvk schema.GroupVersionKind) (*admission.VersionedAttributes, error) { … } func TestShouldCallHook(t *testing.T) { … } type fakeNamespaceLister … func (f fakeNamespaceLister) List(selector labels.Selector) (ret []*corev1.Namespace, err error) { … } func (f fakeNamespaceLister) Get(name string) (*corev1.Namespace, error) { … } func BenchmarkShouldCallHookWithComplexSelector(b *testing.B) { … } func BenchmarkShouldCallHookWithComplexRule(b *testing.B) { … } func BenchmarkShouldCallHookWithComplexSelectorAndRule(b *testing.B) { … }