func TestAdmission(t *testing.T) { … } func replaceManagedFields(with []metav1.ManagedFieldsEntry) func(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) error { … } type mockAdmissionController … func (c *mockAdmissionController) Handles(operation admission.Operation) bool { … } func (c *mockAdmissionController) Admit(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) error { … }