kubernetes/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go

var matchEverythingRules

var sideEffectsUnknown

var sideEffectsNone

var sideEffectsSome

var sideEffectsNoneOnDryRun

var reinvokeNever

var reinvokeIfNeeded

// NewFakeValidatingDataSource returns a mock client and informer returning the given webhooks.
func NewFakeValidatingDataSource(name string, webhooks []registrationv1.ValidatingWebhook, stopCh <-chan struct{}

// NewFakeMutatingDataSource returns a mock client and informer returning the given webhooks.
func NewFakeMutatingDataSource(name string, webhooks []registrationv1.MutatingWebhook, stopCh <-chan struct{}

func newAttributesRecord(object metav1.Object, oldObject metav1.Object, kind schema.GroupVersionKind, namespace string, name string, resource string, labels map[string]string, dryRun bool) admission.Attributes {}

type FakeAttributes

// AddAnnotation adds an annotation key value pair to FakeAttributes
func (f *FakeAttributes) AddAnnotation(k, v string) error {}

// AddAnnotationWithLevel adds an annotation key value pair to FakeAttributes
func (f *FakeAttributes) AddAnnotationWithLevel(k, v string, _ auditinternal.Level) error {}

// GetAnnotations reads annotations from FakeAttributes
func (f *FakeAttributes) GetAnnotations(level auditinternal.Level) map[string]string {}

// NewAttribute returns static admission Attributes for testing.
func NewAttribute(namespace string, labels map[string]string, dryRun bool) admission.Attributes {}

// NewAttributeUnstructured returns static admission Attributes for testing with custom resources.
func NewAttributeUnstructured(namespace string, labels map[string]string, dryRun bool) admission.Attributes {}

type urlConfigGenerator

func (c urlConfigGenerator) ccfgURL(urlPath string) registrationv1.WebhookClientConfig {}

type ValidatingTest

type MutatingTest

type DurationTest

// ConvertToMutatingTestCases converts a validating test case to a mutating one for test purposes.
func ConvertToMutatingTestCases(tests []ValidatingTest, configurationName string) []MutatingTest {}

// ConvertToMutatingWebhooks converts a validating webhook to a mutating one for test purposes.
func ConvertToMutatingWebhooks(webhooks []registrationv1.ValidatingWebhook) []registrationv1.MutatingWebhook {}

// NewNonMutatingTestCases returns test cases with a given base url.
// All test cases in NewNonMutatingTestCases have no Patch set in
// AdmissionResponse. The test cases are used by both MutatingAdmissionWebhook
// and ValidatingAdmissionWebhook.
func NewNonMutatingTestCases(url *url.URL) []ValidatingTest {}

// NewNonMutatingPanicTestCases returns test cases with a given base url.
// All test cases in NewNonMutatingTestCases have no Patch set in
// AdmissionResponse. The expected responses are set for panic handling.
func NewNonMutatingPanicTestCases(url *url.URL) []ValidatingTest {}

func mutationAnnotationValue(configuration, webhook string, mutated bool) string {}

func patchAnnotationValue(configuration, webhook string, patch string) string {}

// NewMutatingTestCases returns test cases with a given base url.
// All test cases in NewMutatingTestCases have Patch set in
// AdmissionResponse. The test cases are only used by both MutatingAdmissionWebhook.
func NewMutatingTestCases(url *url.URL, configurationName string) []MutatingTest {}

type CachedTest

// NewCachedClientTestcases returns a set of client manager test cases.
func NewCachedClientTestcases(url *url.URL) []CachedTest {}

// ccfgSVC returns a client config using the service reference mechanism.
func ccfgSVC(urlPath string) registrationv1.WebhookClientConfig {}

func newMatchEverythingRules() []registrationv1.RuleWithOperations {}

// NewObjectInterfacesForTest returns an ObjectInterfaces appropriate for test cases in this file.
func NewObjectInterfacesForTest() admission.ObjectInterfaces {}

// NewValidationDurationTestCases returns test cases for webhook duration test
func NewValidationDurationTestCases(url *url.URL) []DurationTest {}