Documentation ¶
Index ¶
- func CreateDialContext(ctx context.Context, t *testing.T, ing *v1alpha1.Ingress, ...) func(context.Context, string, string) (net.Conn, error)
- func CreateGRPCService(ctx context.Context, t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
- func CreateIngress(ctx context.Context, t *testing.T, clients *test.Clients, ...) (*v1alpha1.Ingress, context.CancelFunc)
- func CreateIngressReady(ctx context.Context, t *testing.T, clients *test.Clients, ...) (*v1alpha1.Ingress, *http.Client, context.CancelFunc)
- func CreateIngressReadyWithTLS(ctx context.Context, t *testing.T, clients *test.Clients, ...) (*v1alpha1.Ingress, *http.Client, context.CancelFunc)
- func CreateProxyService(ctx context.Context, t *testing.T, clients *test.Clients, target string, ...) (string, int, context.CancelFunc)
- func CreateRetryService(ctx context.Context, t *testing.T, clients *test.Clients) (string, int, context.CancelFunc)
- func CreateRuntimeService(ctx context.Context, t *testing.T, clients *test.Clients, portName string, ...) (string, int, context.CancelFunc)
- func CreateTLSSecret(ctx context.Context, t *testing.T, clients *test.Clients, hosts []string) (string, *tls.Config, context.CancelFunc)
- func CreateTimeoutService(ctx context.Context, t *testing.T, clients *test.Clients) (string, int, context.CancelFunc)
- func CreateWebsocketService(ctx context.Context, t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
- func DumpResponse(_ context.Context, t *testing.T, resp *http.Response)
- func IsDialError(err error) bool
- func IsIngressReady(r *v1alpha1.Ingress) (bool, error)
- func PodWithOption(pod *corev1.Pod, po ...PodOption) *corev1.Pod
- func RunConformance(t *testing.T)
- func RuntimeRequest(ctx context.Context, t *testing.T, client *http.Client, url string, ...) *types.RuntimeInfo
- func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *http.Client, url string, ...) *types.RuntimeInfo
- func TestBasics(t *testing.T)
- func TestBasicsHTTP2(t *testing.T)
- func TestGRPC(t *testing.T)
- func TestGRPCSplit(t *testing.T)
- func TestHTTPOption(t *testing.T)
- func TestIngressClass(t *testing.T)
- func TestIngressTLS(t *testing.T)
- func TestMultipleHosts(t *testing.T)
- func TestPath(t *testing.T)
- func TestPathAndPercentageSplit(t *testing.T)
- func TestPercentage(t *testing.T)
- func TestPostSplitSetHeaders(t *testing.T)
- func TestPreSplitSetHeaders(t *testing.T)
- func TestProbeHeaders(t *testing.T)
- func TestRetry(t *testing.T)
- func TestRewriteHost(t *testing.T)
- func TestRule(t *testing.T)
- func TestTagHeaders(t *testing.T)
- func TestTimeout(t *testing.T)
- func TestUpdate(t *testing.T)
- func TestVisibility(t *testing.T)
- func TestVisibilityPath(t *testing.T)
- func TestVisibilitySplit(t *testing.T)
- func TestWebsocket(t *testing.T)
- func TestWebsocketSplit(t *testing.T)
- func UpdateIngress(ctx context.Context, t *testing.T, clients *test.Clients, name string, ...)
- func UpdateIngressReady(ctx context.Context, t *testing.T, clients *test.Clients, name string, ...)
- func WaitForIngressState(ctx context.Context, client *test.NetworkingClients, name string, ...) error
- type Option
- type PodOption
- type RequestOption
- type ResponseExpectation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDialContext ¶
func CreateDialContext(ctx context.Context, 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 CreateGRPCService ¶
func CreateGRPCService(ctx context.Context, 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(ctx context.Context, t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec, io ...Option) (*v1alpha1.Ingress, context.CancelFunc)
CreateIngress creates a Knative Ingress resource
func CreateIngressReady ¶
func CreateProxyService ¶
func CreateProxyService(ctx context.Context, 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 CreateRetryService ¶
func CreateRetryService(ctx context.Context, t *testing.T, clients *test.Clients) (string, int, context.CancelFunc)
CreateRetryService creates a service that will return a 503 on first access, and then 200 after that.
func CreateRuntimeService ¶
func CreateRuntimeService(ctx context.Context, t *testing.T, clients *test.Clients, portName string, appProtocol ...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(ctx context.Context, t *testing.T, clients *test.Clients, hosts []string) (string, *tls.Config, context.CancelFunc)
CreateTLSSecret creates a secret with TLS certs in the serving namespace. This is based on https://golang.org/src/crypto/tls/generate_cert.go
func CreateTimeoutService ¶
func CreateTimeoutService(ctx context.Context, 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(ctx context.Context, 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 IsDialError ¶
func IsIngressReady ¶
IsIngressReady will check the status conditions of the ingress and return true if the ingress is ready.
func PodWithOption ¶
PodWithOption modifies pod objects with PodOptions.
func RunConformance ¶
RunConformance will run ingress conformance tests
Depending on the options it may test alpha and beta features
func RuntimeRequest ¶
func RuntimeRequest(ctx context.Context, t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo
func RuntimeRequestWithExpectations ¶
func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *http.Client, url string, responseExpectations []ResponseExpectation, allowDialError bool, opts ...RequestOption) *types.RuntimeInfo
RuntimeRequestWithExpectations attempts to make a request to url and return runtime information. If connection is successful only then it will validate all response expectations. If allowDialError is set to true then function will not fail if connection is a dial error.
func TestBasics ¶
TestBasics verifies that a no frills Ingress exposes a simple Pod/Service via the public load balancer.
func TestBasicsHTTP2 ¶
TestBasicsHTTP2 verifies that the same no-frills Ingress over a Service with http/2 configured will see a ProtoMajor of 2.
func TestGRPCSplit ¶
TestGRPCSplit verifies that websockets may be used across a traffic split.
func TestHTTPOption ¶
TestHTTPOption verifies that the Ingress properly handles HTTPOption field.
func TestIngressClass ¶
TestIngressClass verifies that kingress does not pick ingress up when ingress.class annotation is incorrect.
func TestIngressTLS ¶
TestIngressTLS verifies that the Ingress properly handles the TLS field.
func TestMultipleHosts ¶
TestMultipleHosts verifies that an Ingress can respond to multiple hosts.
func TestPath ¶
TestPath verifies that an Ingress properly dispatches to backends based on the path of the URL.
func TestPercentage ¶
TestPercentage verifies that an Ingress splitting over multiple backends respects the given percentage distribution.
func TestPostSplitSetHeaders ¶
TestPostSplitSetHeaders verifies that an Ingress that specified AppendHeaders post-split has the appropriate header(s) set.
func TestPreSplitSetHeaders ¶
TestPreSplitSetHeaders verifies that an Ingress that specified AppendHeaders pre-split has the appropriate header(s) set.
func TestProbeHeaders ¶
TestProbeHeaders verifies that an KIngress implemented the dataplane contract for probe request.
func TestRewriteHost ¶
TestRewriteHost verifies that a RewriteHost rule can be used to implement vanity URLs.
func TestRule ¶
TestRule verifies that an Ingress properly dispatches to backends based on different rules.
func TestTagHeaders ¶
TestTagHeaders verifies that an Ingress properly dispatches to backends based on the tag header
See proposal doc for reference: https://docs.google.com/document/d/12t_3NE4EqvW_l0hfVlQcAGKkwkAM56tTn2wN_JtHbSQ/edit?usp=sharing
func TestTimeout ¶
TestTimeout verifies that an Ingress implements "no timeout".
func TestUpdate ¶
TestUpdate verifies that when the network programming changes that traffic isn't dropped.
func TestVisibility ¶
func TestVisibilityPath ¶
func TestVisibilitySplit ¶
func TestWebsocket ¶
TestWebsocket verifies that websockets may be used via a simple Ingress.
func TestWebsocketSplit ¶
TestWebsocketSplit verifies that websockets may be used across a traffic split.
func UpdateIngress ¶
func UpdateIngress(ctx context.Context, t *testing.T, clients *test.Clients, name string, spec v1alpha1.IngressSpec)
UpdateIngress updates a Knative Ingress resource
func UpdateIngressReady ¶
func WaitForIngressState ¶
func WaitForIngressState(ctx context.Context, client *test.NetworkingClients, name string, inState func(r *v1alpha1.Ingress) (bool, error), desc string) error
WaitForIngressState polls the status of the Ingress called name from client every PollInterval until inState returns `true` indicating it is done, returns an error or PollTimeout. desc will be used to name the metric that is emitted to track how long it took for name to get into the state checked by inState.
Types ¶
type Option ¶
Option enables further configuration of a Ingress.
func OverrideIngressAnnotation ¶
OverrideIngressAnnotation overrides the Ingress annotation.
type PodOption ¶
PodOption enables further configuration of a Pod.
func WithReadinessSchemeHTTPS ¶
func WithReadinessSchemeHTTPS() PodOption
WithReadinessSchemeHTTPS adds https scheme to readiness probe.
func WithVolume ¶
func WithVolume(name, mountPath string, volumeSource corev1.VolumeSource) PodOption
WithVolume adds a volume to the pod.
type RequestOption ¶
type ResponseExpectation ¶
func StatusCodeExpectation ¶
func StatusCodeExpectation(statusCodes sets.Set[int]) ResponseExpectation