testing

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutateK8sService

func MutateK8sService(svc *corev1.Service)

MutateK8sService changes the service in a way that must be reconciled.

func SKS

func SKS(ns, name string, so ...SKSOption) *netv1alpha1.ServerlessService

SKS creates a generic ServerlessService object.

func WithEndpointsOwnersRemoved

func WithEndpointsOwnersRemoved(eps *corev1.Endpoints)

WithEndpointsOwnersRemoved clears the owner references of this Endpoints resource.

func WithHPAClass

func WithHPAClass(pa *autoscalingv1alpha1.PodAutoscaler)

WithHPAClass updates the PA to add the hpa class annotation.

func WithK8sSvcOwnersRemoved

func WithK8sSvcOwnersRemoved(svc *corev1.Service)

WithK8sSvcOwnersRemoved clears the owner references of this Service.

func WithKPAClass

func WithKPAClass(pa *autoscalingv1alpha1.PodAutoscaler)

WithKPAClass updates the PA to add the kpa class annotation.

func WithPADeletionTimestamp

func WithPADeletionTimestamp(r *autoscalingv1alpha1.PodAutoscaler)

WithPADeletionTimestamp will set the DeletionTimestamp on the PodAutoscaler.

func WithPAOwnersRemoved

func WithPAOwnersRemoved(pa *autoscalingv1alpha1.PodAutoscaler)

WithPAOwnersRemoved clears the owner references of this PA resource.

func WithPodAutoscalerOwnersRemoved

func WithPodAutoscalerOwnersRemoved(r *autoscalingv1alpha1.PodAutoscaler)

WithPodAutoscalerOwnersRemoved clears the owner references of this PodAutoscaler.

func WithProxyMode

func WithProxyMode(sks *netv1alpha1.ServerlessService)

WithProxyMode puts SKS into proxy mode.

func WithPubService

func WithPubService(sks *netv1alpha1.ServerlessService)

WithPubService annotates SKS status with the given service name.

func WithSKSOwnersRemoved

func WithSKSOwnersRemoved(sks *netv1alpha1.ServerlessService)

WithSKSOwnersRemoved clears the owner references of this SKS resource.

func WithSKSReady

func WithSKSReady(sks *netv1alpha1.ServerlessService)

WithSKSReady marks SKS as ready.

func WithSubsets

func WithSubsets(ep *corev1.Endpoints)

WithSubsets adds subsets to the body of a Revision, enabling us to refer readiness.

func WithTraffic

func WithTraffic(pa *autoscalingv1alpha1.PodAutoscaler)

WithTraffic updates the PA to reflect it receiving traffic.

Types

type EndpointsOption

type EndpointsOption func(*corev1.Endpoints)

EndpointsOption enables further configuration of the Kubernetes Endpoints.

type IngressOption added in v0.8.0

type IngressOption func(netv1alpha1.IngressAccessor)

IngressOption enables further configuration of the IngressAccessor.

func WithHosts

func WithHosts(index int, hosts ...string) IngressOption

WithHosts sets the Hosts of the ingress rule specified index

type K8sServiceOption

type K8sServiceOption func(*corev1.Service)

K8sServiceOption enables further configuration of the Kubernetes Service.

func OverrideServiceName

func OverrideServiceName(name string) K8sServiceOption

OverrideServiceName changes the name of the Kubernetes Service.

func SvcWithAnnotationValue

func SvcWithAnnotationValue(key, value string) K8sServiceOption

func WithClusterIP

func WithClusterIP(ip string) K8sServiceOption

WithClusterIP assigns a ClusterIP to the K8s Service.

func WithExternalName

func WithExternalName(name string) K8sServiceOption

WithExternalName gives external name to the K8s Service.

func WithSvcSelector

func WithSvcSelector(sel map[string]string) K8sServiceOption

WithSvcSelector sets the selector of the service.

type PodAutoscalerOption

type PodAutoscalerOption func(*autoscalingv1alpha1.PodAutoscaler)

PodAutoscalerOption is an option that can be applied to a PA.

func MarkResourceNotOwnedByPA

func MarkResourceNotOwnedByPA(rType, name string) PodAutoscalerOption

MarkResourceNotOwnedByPA marks PA when it's now owning a resources it is supposed to own.

func WithBufferedTraffic

func WithBufferedTraffic(reason, message string) PodAutoscalerOption

WithBufferedTraffic updates the PA to reflect that it has received and buffered traffic while it is being activated.

func WithLowerScaleBound

func WithLowerScaleBound(i int) PodAutoscalerOption

WithLowerScaleBound sets minScale to the given number.

func WithMSvcStatus

func WithMSvcStatus(s string) PodAutoscalerOption

WithMSvcStatus sets the name of the metrics service.

func WithMetricAnnotation

func WithMetricAnnotation(metric string) PodAutoscalerOption

WithMetricAnnotation adds a metric annotation to the PA.

func WithNoTraffic

func WithNoTraffic(reason, message string) PodAutoscalerOption

WithNoTraffic updates the PA to reflect the fact that it is not receiving traffic.

func WithPAContainerConcurrency added in v0.8.0

func WithPAContainerConcurrency(cc v1beta1.RevisionContainerConcurrencyType) PodAutoscalerOption

WithPAContainerConcurrency returns a PodAutoscalerOption which sets the PodAutoscaler containerConcurrency to the provided value.

func WithPAStatusService

func WithPAStatusService(svc string) PodAutoscalerOption

WithPAStatusService annotats PA Status with the provided service name.

func WithPanicThresholdPercentageAnnotation

func WithPanicThresholdPercentageAnnotation(percentage string) PodAutoscalerOption

WithPanicThresholdPercentageAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev/targetPanicPercentage annotation to the provided value.

func WithPanicWindowPercentageAnnotation

func WithPanicWindowPercentageAnnotation(percentage string) PodAutoscalerOption

WithPanicWindowPercentageAnnotation retturn a PodAutoscalerOption which set the PodAutoscaler autoscaling.knative.dev/windowPanicPercentage annotation to the provided value.

func WithProtocolType

func WithProtocolType(pt networking.ProtocolType) PodAutoscalerOption

WithProtocolType sets the protocol type on the PodAutoscaler.

func WithTUAnnotation added in v0.8.0

func WithTUAnnotation(tu string) PodAutoscalerOption

WithTUAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev//targetUtilizationPercentage annotation to the provided value.

func WithTargetAnnotation

func WithTargetAnnotation(target string) PodAutoscalerOption

WithTargetAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev/target annotation to the provided value.

func WithUpperScaleBound

func WithUpperScaleBound(i int) PodAutoscalerOption

WithUpperScaleBound sets maxScale to the given number.

func WithWindowAnnotation

func WithWindowAnnotation(window string) PodAutoscalerOption

WithWindowAnnotation returns a PodAutoScalerOption which sets the PodAutoscaler autoscaling.knative.dev/window annotation to the provided value.

type PodOption

type PodOption func(*corev1.Pod)

PodOption enables further configuration of a Pod.

func WithFailingContainer

func WithFailingContainer(name string, exitCode int, message string) PodOption

WithFailingContainer sets the .Status.ContainerStatuses on the pod to include a container named accordingly to fail with the given state.

func WithUnschedulableContainer

func WithUnschedulableContainer(reason, message string) PodOption

WithUnschedulableContainer sets the .Status.Conditionss on the pod to include `PodScheduled` status to `False` with the given message and reason.

func WithWaitingContainer

func WithWaitingContainer(name, reason, message string) PodOption

WithWaitingContainer sets the .Status.ContainerStatuses on the pod to include a container named accordingly to wait with the given state.

type SKSOption

type SKSOption func(sks *netv1alpha1.ServerlessService)

SKSOption is a callback type for decorate SKS objects.

func WithDeployRef

func WithDeployRef(name string) SKSOption

WithDeployRef annotates SKS with a deployment objectRef

func WithPrivateService

func WithPrivateService(n string) SKSOption

WithPrivateService annotates SKS status with the private service name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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