admissiontest

package
v0.14.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package admissiontest contains fake webhooks for validating admission webhooks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeValidator

type FakeValidator struct {
	// ErrorToReturn is the error for which the FakeValidator rejects all requests
	ErrorToReturn error `json:"ErrorToReturn,omitempty"`
	// GVKToReturn is the GroupVersionKind that the webhook operates on
	GVKToReturn schema.GroupVersionKind
}

FakeValidator provides fake validating webhook functionality for testing It implements the admission.Validator interface and rejects all requests with the same configured error or passes if ErrorToReturn is nil.

func (*FakeValidator) DeepCopyObject

func (v *FakeValidator) DeepCopyObject() runtime.Object

DeepCopyObject implements admission.Validator.

func (*FakeValidator) GetObjectKind

func (v *FakeValidator) GetObjectKind() schema.ObjectKind

GetObjectKind implements admission.Validator.

func (*FakeValidator) GroupVersionKind

func (v *FakeValidator) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind implements admission.Validator.

func (*FakeValidator) SetGroupVersionKind

func (v *FakeValidator) SetGroupVersionKind(gvk schema.GroupVersionKind)

SetGroupVersionKind implements admission.Validator.

func (*FakeValidator) ValidateCreate

func (v *FakeValidator) ValidateCreate() error

ValidateCreate implements admission.Validator.

func (*FakeValidator) ValidateDelete

func (v *FakeValidator) ValidateDelete() error

ValidateDelete implements admission.Validator.

func (*FakeValidator) ValidateUpdate

func (v *FakeValidator) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements admission.Validator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL