validation

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCondition

func FindCondition(condType string, c []orchestrationapi.Condition) *orchestrationapi.Condition

func FindRoleStatus

func FindRoleStatus(rs *orchestrationapi.RoleSet, roleName string) *orchestrationapi.RoleStatus

func GetHPA

func GetHPA(ctx context.Context,
	k8sClient client.Client,
	namespace, name string) *autoscalingv2.HorizontalPodAutoscaler

GetHPA fetches an HPA by namespace and name.

func GetPodAutoscaler

GetPodAutoscaler fetches the latest version of a PodAutoscaler.

func GetRoleSetPodForRole

func GetRoleSetPodForRole(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns, roleName string) []*corev1.Pod

GetRoleSetPodForRole list the pod for certain role

func MakePodReady

func MakePodReady(pod *corev1.Pod)

func MakePodTemplate

func MakePodTemplate(image string) corev1.PodTemplateSpec

func MarkPodsReady

func MarkPodsReady(ctx context.Context, k8sClient client.Client, ns, podLabelKey, podLabelValue string)

func StartRoleSetPodReadyLoop

func StartRoleSetPodReadyLoop(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns string) chan struct{}

func UpdateRolesTemplate

func UpdateRolesTemplate(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	roleTemplateMap map[string]string)

UpdateRolesTemplate update the template of roles

func UpdateStormServiceReplicas

func UpdateStormServiceReplicas(ctx context.Context, k8sClient client.Client, ss *orchestrationapi.StormService,
	replicas int)

func ValidateHPAOwnerReference

func ValidateHPAOwnerReference(hpa *autoscalingv2.HorizontalPodAutoscaler,
	expectedOwnerName string,
	expectedOwnerKind string)

ValidateHPAOwnerReference validates the HPA's OwnerReference.

func ValidateHPAScaleTargetRef

func ValidateHPAScaleTargetRef(hpa *autoscalingv2.HorizontalPodAutoscaler,
	expectedKind, expectedName string)

ValidateHPAScaleTargetRef validates the HPA's scale target reference.

func ValidateHPASpec

func ValidateHPASpec(hpa *autoscalingv2.HorizontalPodAutoscaler,
	expectedMinReplicas, expectedMaxReplicas int32)

ValidateHPASpec validates the HPA spec fields.

func ValidatePodAutoscalerCondition

func ValidatePodAutoscalerCondition(pa *autoscalingv1alpha1.PodAutoscaler,
	conditionType string,
	expectedStatus metav1.ConditionStatus,
	expectedReason string)

ValidatePodAutoscalerCondition validates a specific condition in a PodAutoscaler.

func ValidatePodAutoscalerConditionExists

func ValidatePodAutoscalerConditionExists(pa *autoscalingv1alpha1.PodAutoscaler,
	conditionType string)

ValidatePodAutoscalerConditionExists validates that a condition exists.

func ValidatePodAutoscalerConditionNotExists

func ValidatePodAutoscalerConditionNotExists(pa *autoscalingv1alpha1.PodAutoscaler,
	conditionType string)

ValidatePodAutoscalerConditionNotExists validates that a condition does not exist.

func ValidatePodAutoscalerScaling

func ValidatePodAutoscalerScaling(ctx context.Context,
	k8sClient client.Client,
	pa *autoscalingv1alpha1.PodAutoscaler,
	expectedDesired, expectedActual int32)

ValidatePodAutoscalerScaling validates the scaling status (desiredScale and actualScale).

func ValidatePodAutoscalerSpec

func ValidatePodAutoscalerSpec(pa *autoscalingv1alpha1.PodAutoscaler,
	expectedMin, expectedMax int32,
	expectedStrategy autoscalingv1alpha1.ScalingStrategyType)

ValidatePodAutoscalerSpec validates the spec fields of a PodAutoscaler.

func ValidatePodSetSpec

func ValidatePodSetSpec(podset *orchestrationapi.PodSet, expectedPodGroupSize int32, expectedStateful bool)

func ValidatePodSetStatus

func ValidatePodSetStatus(ctx context.Context, k8sClient client.Client,
	podset *orchestrationapi.PodSet, expectedPhase orchestrationapi.PodSetPhase, expectedTotal, expectedReady int32)

func ValidateRoleImage

func ValidateRoleImage(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns, role, expectedImage string) error

ValidateRoleImage Verify all pods of a certain role have the new images

func ValidateRoleSetSpec

func ValidateRoleSetSpec(roleSet *orchestrationapi.RoleSet,
	expectedRoleCount int,
	updateStrategyType orchestrationapi.RoleSetUpdateStrategyType)

ValidateRoleSetSpec verify the roleSet spec

func ValidateRoleStatus

func ValidateRoleStatus(rs *orchestrationapi.RoleSet, role string, expectedReplicas int32) error

ValidateRoleStatus verify RoleStatus of a role

func ValidateScalingHistory

func ValidateScalingHistory(pa *autoscalingv1alpha1.PodAutoscaler,
	expectedCount int,
	checkLatest func(autoscalingv1alpha1.ScalingDecision))

ValidateScalingHistory validates the scalingHistory in status.

func ValidateStormServiceConditions

func ValidateStormServiceConditions(ss *orchestrationapi.StormService,
	condition orchestrationapi.ConditionType, readyStatus corev1.ConditionStatus) error

func ValidateStormServiceReplicas

func ValidateStormServiceReplicas(
	ctx context.Context,
	k8sClient client.Client,
	stormService *orchestrationapi.StormService,
	expectedReplicas int32,
)

func ValidateStormServiceSpec

func ValidateStormServiceSpec(stormService *orchestrationapi.StormService, expectedReplicas int32,
	updateStrategyType orchestrationapi.StormServiceUpdateStrategyType)

func ValidateStormServiceStatus

func ValidateStormServiceStatus(ctx context.Context, k8sClient client.Client,
	stormService *orchestrationapi.StormService,
	expectedReplicas, expectedReady, expectedNotReady,
	expectedCurrent, expectedUpdated, expectedUpdatedReady int32,
	checkRevisions bool)

func WaitForHPACreated

func WaitForHPACreated(ctx context.Context,
	k8sClient client.Client,
	namespace, name string) *autoscalingv2.HorizontalPodAutoscaler

WaitForHPACreated waits for an HPA to be created and returns it.

func WaitForHPADeleted

func WaitForHPADeleted(ctx context.Context,
	k8sClient client.Client,
	namespace, name string)

WaitForHPADeleted waits for an HPA to be deleted.

func WaitForPodAutoscalerCondition

func WaitForPodAutoscalerCondition(ctx context.Context,
	k8sClient client.Client,
	pa *autoscalingv1alpha1.PodAutoscaler,
	conditionType string,
	expectedStatus metav1.ConditionStatus)

WaitForPodAutoscalerCondition waits for a specific condition to reach expected status.

func WaitForPodAutoscalerConditionWithReason

func WaitForPodAutoscalerConditionWithReason(ctx context.Context,
	k8sClient client.Client,
	pa *autoscalingv1alpha1.PodAutoscaler,
	conditionType string,
	expectedStatus metav1.ConditionStatus,
	expectedReason string)

WaitForPodAutoscalerConditionWithReason waits for a condition with specific reason.

func WaitForPodAutoscalerCreated

func WaitForPodAutoscalerCreated(ctx context.Context,
	k8sClient client.Client,
	pa *autoscalingv1alpha1.PodAutoscaler) *autoscalingv1alpha1.PodAutoscaler

WaitForPodAutoscalerCreated waits for PodAutoscaler to be created and returns the latest version.

func WaitForPodAutoscalerDeleted

func WaitForPodAutoscalerDeleted(ctx context.Context,
	k8sClient client.Client,
	pa *autoscalingv1alpha1.PodAutoscaler)

WaitForPodAutoscalerDeleted waits for PodAutoscaler to be deleted.

func WaitForPodsCreated

func WaitForPodsCreated(ctx context.Context, k8sClient client.Client,
	ns, podLabelKey, podLabelValue string, expected int)

func WaitForRoleImage

func WaitForRoleImage(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns, role, expectedImage string, description ...interface{})

WaitForRoleImage verify role have expected image and make the pod ready

func WaitForRoleImageAndReady

func WaitForRoleImageAndReady(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns, role, expectedImage string, description ...interface{})

WaitForRoleImageAndReady verify role have expected image and make the pod ready

func WaitForRoleSetFinalState

func WaitForRoleSetFinalState(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet,
	ns string, roleImageMap map[string]string)

WaitForRoleSetFinalState verify roleSet final state

func WaitForRoleSetsCreated

func WaitForRoleSetsCreated(ctx context.Context, k8sClient client.Client, ns, ssName string, expected int)

func WaitForRoleUpgradeInOrder

func WaitForRoleUpgradeInOrder(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet, ns,
	firstRole, firstImage,
	secondRole, secondImage string)

WaitForRoleUpgradeInOrder verify the role upgrade order

func WaitForRolesReady

func WaitForRolesReady(ctx context.Context, k8sClient client.Client, rs *orchestrationapi.RoleSet, roleList []string)

WaitForRolesReady verify role in the role list is ready

Types

This section is empty.

Jump to

Keyboard shortcuts

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