ingress

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDialContext

func CreateDialContext(t *testing.T, ing *v1alpha1.Ingress, clients *test.Clients) func(context.Context, string, string) (net.Conn, error)

CreateDialContext looks up the endpoint information to create a "dialer" for the provided Ingress' public ingress loas balancer. It can be used to contact external-visibility services with an HTTP client via:

client := &http.Client{
	Transport: &http.Transport{
		DialContext: CreateDialContext(t, ing, clients),
	},
}

func CreateFlakyService

func CreateFlakyService(t *testing.T, clients *test.Clients, period int) (string, int, context.CancelFunc)

CreateFlakyService creates a Kubernetes service where the backing pod will succeed only every Nth request.

func CreateGRPCService

func CreateGRPCService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)

CreateGRPCService creates a Kubernetes service that will upgrade the connection to use GRPC and echo back the received messages with the provided suffix.

func CreateIngress

func CreateIngress(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, context.CancelFunc)

CreateIngress creates a Knative Ingress resource

func CreateIngressReady

func CreateIngressReady(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, *http.Client, context.CancelFunc)

func CreateIngressReadyDialContext

func CreateIngressReadyDialContext(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, func(context.Context, string, string) (net.Conn, error), context.CancelFunc)

func CreateProxyService added in v0.13.0

func CreateProxyService(t *testing.T, clients *test.Clients, target string, gatewayDomain string) (string, int, context.CancelFunc)

CreateProxyService creates a Kubernetes service that will forward requests to the specified target. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.

func CreateRuntimeService

func CreateRuntimeService(t *testing.T, clients *test.Clients, portName string) (string, int, context.CancelFunc)

CreateRuntimeService creates a Kubernetes service that will respond to the protocol specified with the given portName. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.

func CreateTLSSecret

func CreateTLSSecret(t *testing.T, clients *test.Clients, hosts []string) (string, context.CancelFunc)

This is based on https://golang.org/src/crypto/tls/generate_cert.go

func CreateTLSSecretWithCertPool

func CreateTLSSecretWithCertPool(t *testing.T, clients *test.Clients, hosts []string, ns string, cas *x509.CertPool) (string, context.CancelFunc)

CreateTLSSecretWithCertPool creates TLS certificate with given CertPool.

func CreateTimeoutService

func CreateTimeoutService(t *testing.T, clients *test.Clients) (string, int, context.CancelFunc)

CreateTimeoutService creates a Kubernetes service that will respond to the protocol specified with the given portName. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.

func CreateWebsocketService

func CreateWebsocketService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)

CreateWebsocketService creates a Kubernetes service that will upgrade the connection to use websockets and echo back the received messages with the provided suffix.

func DumpResponse

func DumpResponse(t *testing.T, resp *http.Response)

func RuntimeRequest

func RuntimeRequest(t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo

func RuntimeRequestWithStatus added in v0.13.0

func RuntimeRequestWithStatus(t *testing.T, client *http.Client, url string, expectedStatus sets.Int, opts ...RequestOption) *types.RuntimeInfo

func UpdateIngress

func UpdateIngress(t *testing.T, clients *test.Clients, name string, spec v1alpha1.IngressSpec)

UpdateIngress updates a Knative Ingress resource

func UpdateIngressReady

func UpdateIngressReady(t *testing.T, clients *test.Clients, name string, spec v1alpha1.IngressSpec)

Types

type RequestOption

type RequestOption func(*http.Request)

Jump to

Keyboard shortcuts

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