kubernetes/plugin/pkg/admission/imagepolicy/admission_test.go

const defaultConfigTmplJSON

const defaultConfigTmplYAML

func TestNewFromConfig(t *testing.T) {}

type Service

// NewTestServer wraps a Service as an httptest.Server.
func NewTestServer(s Service, cert, key, caCert []byte) (*httptest.Server, error) {}

type mockService

func (m *mockService) Review(r *v1alpha1.ImageReview) {}

func (m *mockService) Allow()              {}

func (m *mockService) Deny()               {}

func (m *mockService) HTTPStatusCode() int {}

// newImagePolicyWebhook creates a temporary kubeconfig file from the provided arguments and attempts to load
// a new newImagePolicyWebhook from it.
func newImagePolicyWebhook(callbackURL string, clientCert, clientKey, ca []byte, cacheTime time.Duration, defaultAllow bool) (*Plugin, error) {}

func TestTLSConfig(t *testing.T) {}

type webhookCacheTestCase

func testWebhookCacheCases(t *testing.T, serv *mockService, wh *Plugin, attr admission.Attributes, tests []webhookCacheTestCase) {}

// TestWebhookCache verifies that error responses from the server are not
// cached, but successful responses are.
func TestWebhookCache(t *testing.T) {}

func TestContainerCombinations(t *testing.T) {}

type fakeAttributes

func (f fakeAttributes) AddAnnotation(k, v string) error {}

func TestDefaultAllow(t *testing.T) {}

type annotationService

func (a *annotationService) Review(r *v1alpha1.ImageReview) {}

func (a *annotationService) HTTPStatusCode() int            {}

func (a *annotationService) Annotations() map[string]string {}

func TestAnnotationFiltering(t *testing.T) {}

func TestReturnedAnnotationAdd(t *testing.T) {}

func goodPod(containerID string) *api.Pod {}