Documentation ¶
Index ¶
- func CheckEndpoints(t *testing.T, eps *corev1.Endpoints, wantedPod int) (bool, error)
- func LabelsAsSelectorString(lbs map[string]string) string
- func NewDeployment(namespace, name, image, tag string, command []string, replicas int32) *appsv1.Deployment
- func NewKanaryDeployment(namespace, name, deploymentName, serviceName, image, tag string, ...) *kanaryv1alpha1.KanaryDeployment
- func NewService(namespace, name string, labelsSelector map[string]string) *corev1.Service
- func RandValueIn(base int, delta int) float64
- func SanitizeLabel(label string) string
- func UpdateDeploymentFunc(f *framework.Framework, name, namespace string, ...) error
- func UpdateKanaryDeploymentFunc(f *framework.Framework, namespace, name string, ...) error
- func WaitForEndpointsCount(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, ...) error
- func WaitForFuncOnDeployment(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, ...) error
- func WaitForFuncOnEndpoints(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, ...) error
- func WaitForFuncOnHPA(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, ...) error
- func WaitForFuncOnKanaryDeployment(t *testing.T, client framework.FrameworkClient, namespace, name string, ...) error
- func WaitForInvalidStatusOnKanaryDeployment(t *testing.T, client framework.FrameworkClient, namespace, name string, ...) error
- type EndpointCheckFunc
- type PromTestHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEndpoints ¶
CheckEndpoints check if the count of endpoint is the expexted one
func LabelsAsSelectorString ¶
LabelsAsSelectorString albel map to label string
func NewDeployment ¶
func NewDeployment(namespace, name, image, tag string, command []string, replicas int32) *appsv1.Deployment
NewDeployment create a new deployment
func NewKanaryDeployment ¶
func NewKanaryDeployment(namespace, name, deploymentName, serviceName, image, tag string, command []string, replicas int32, scale *kanaryv1alpha1.KanaryDeploymentSpecScale, traffic *kanaryv1alpha1.KanaryDeploymentSpecTraffic, validation *kanaryv1alpha1.KanaryDeploymentSpecValidationList) *kanaryv1alpha1.KanaryDeployment
NewKanaryDeployment create a new Kanary Deployments CR
func NewService ¶
NewService create a new service
func RandValueIn ¶
RandValueIn return a random value +/- delta around the base
func SanitizeLabel ¶
SanitizeLabel sanitize a kubernetes label to be used as prometheus label
func UpdateDeploymentFunc ¶
func UpdateDeploymentFunc(f *framework.Framework, name, namespace string, updateFunc func(kd *appsv1.Deployment)) error
UpdateDeploymentFunc update the deployment using the updateFunc
func UpdateKanaryDeploymentFunc ¶
func UpdateKanaryDeploymentFunc(f *framework.Framework, namespace, name string, updateFunc func(kd *kanaryv1alpha1.KanaryDeployment), retryInterval, timeout time.Duration) error
UpdateKanaryDeploymentFunc used to update a KanaryDeployment with retry and timeout policy
func WaitForEndpointsCount ¶
func WaitForEndpointsCount(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, endpointCount int, retryInterval, timeout time.Duration) error
WaitForEndpointsCount wait for the endpoint to reach a given count
func WaitForFuncOnDeployment ¶
func WaitForFuncOnDeployment(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, f func(dep *appsv1beta1.Deployment) (bool, error), retryInterval, timeout time.Duration) error
WaitForFuncOnDeployment used to wait a valid condition on a Deployment
func WaitForFuncOnEndpoints ¶
func WaitForFuncOnEndpoints(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, f EndpointCheckFunc, retryInterval, timeout time.Duration) error
WaitForFuncOnEndpoints used to wait a valid condition on Endpoints
func WaitForFuncOnHPA ¶
func WaitForFuncOnHPA(t *testing.T, kubeclient kubernetes.Interface, namespace, name string, f func(hpa *v2beta1.HorizontalPodAutoscaler) (bool, error), retryInterval, timeout time.Duration) error
WaitForFuncOnHPA used to wait a valid condition on a HPA
func WaitForFuncOnKanaryDeployment ¶
func WaitForFuncOnKanaryDeployment(t *testing.T, client framework.FrameworkClient, namespace, name string, f func(kd *kanaryv1alpha1.KanaryDeployment) (bool, error), retryInterval, timeout time.Duration) error
WaitForFuncOnKanaryDeployment used to wait a valid condition on a KanaryDeployment
func WaitForInvalidStatusOnKanaryDeployment ¶
func WaitForInvalidStatusOnKanaryDeployment(t *testing.T, client framework.FrameworkClient, namespace, name string, retryInterval, timeout time.Duration) error
WaitForInvalidStatusOnKanaryDeployment used to wait an invalidated status on a KanaryDeployment
Types ¶
type EndpointCheckFunc ¶
EndpointCheckFunc function to perform checks on endpoint object
type PromTestHelper ¶
type PromTestHelper struct {
// contains filtered or unexported fields
}
PromTestHelper struct helps to create a Prometheus pod that rune a prom server and a push gateway
func NewPromTestHelper ¶
func NewPromTestHelper(t *testing.T, ctx *framework.TestCtx, f *framework.Framework, jobName string, collectors []prometheus.Collector) *PromTestHelper
NewPromTestHelper contructor for PromTestHelper
func (*PromTestHelper) Run ¶
func (p *PromTestHelper) Run()
Run deploy the prometheus pod (server+pushgateway) and associated service
func (*PromTestHelper) StopPushGateway ¶
func (p *PromTestHelper) StopPushGateway()
StopPushGateway terminates on going metric push