type PolicyTestContext …
func NewPolicyTestContext[P, B runtime.Object, E Evaluator](
newPolicyAccessor func(P) PolicyAccessor,
newBindingAccessor func(B) BindingAccessor,
compileFunc func(P) E,
dispatcher dispatcherFactory[PolicyHook[P, B, E]],
initialObjects []runtime.Object,
paramMappings []meta.RESTMapping,
) (*PolicyTestContext[P, B, E], func(), error) { … }
func (p *PolicyTestContext[P, B, E]) UpdateAndWait(objects ...runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) Update(objects ...runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) update(wait bool, objects ...runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) WaitForReconcile(timeoutCtx context.Context, object runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) waitForDelete(ctx context.Context, objectGVK schema.GroupVersionKind, name types.NamespacedName) error { … }
func (p *PolicyTestContext[P, B, E]) updateOne(object runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) DeleteAndWait(object ...runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) deleteOne(object runtime.Object) error { … }
func (p *PolicyTestContext[P, B, E]) Dispatch(
new, old runtime.Object,
operation admission.Operation,
) error { … }
func (p *PolicyTestContext[P, B, E]) inferGVK(object runtime.Object) (schema.GroupVersionKind, schema.GroupVersionResource, error) { … }
type FakeList …
func (fl *FakeList[P]) DeepCopyObject() runtime.Object { … }
type fakeAuthorizer …
func (f fakeAuthorizer) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) { … }