common

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestDefaultTimeout  = 15 * time.Second
	TestDefaultDuration = 10 * time.Second
	TestDefaultInterval = 250 * time.Millisecond
)

Variables

View Source
var (
	DefaultTestNamespace = "default"

	DefaultTestISBSvcRolloutName                = "isbservicerollout-test"
	DefaultTestISBSvcName                       = DefaultTestISBSvcRolloutName + "-0"
	DefaultTestPipelineRolloutName              = "pipelinerollout-test"
	DefaultTestPipelineName                     = DefaultTestPipelineRolloutName + "-0"
	DefaultTestMonoVertexRolloutName            = "monovertexrollout-test"
	DefaultTestMonoVertexName                   = DefaultTestMonoVertexRolloutName + "-0"
	DefaultTestNumaflowControllerRolloutName    = "numaflow-controller"
	DefaultTestNumaflowControllerName           = "numaflow-controller" // TODO: change to add "-0" suffix after Progressive
	DefaultTestNumaflowControllerDeploymentName = "numaflow-controller"
)
View Source
var (
	TestRESTConfig    *rest.Config
	TestK8sClient     client.Client
	TestCustomMetrics *metrics.CustomMetrics
)

Functions

func CreateDefaultISBService added in v0.11.0

func CreateDefaultISBService(jetstreamVersion string, phase numaflowv1.ISBSvcPhase, fullyReconciled bool) *numaflowv1.InterStepBufferService

func CreateDefaultISBServiceSpec added in v0.11.0

func CreateDefaultISBServiceSpec(jetstreamVersion string) numaflowv1.InterStepBufferServiceSpec

func CreateDefaultTestMVOfPhase added in v0.10.0

func CreateDefaultTestMVOfPhase(phase numaflowv1.MonoVertexPhase) *numaflowv1.MonoVertex

func CreateDefaultTestPipelineOfPhase

func CreateDefaultTestPipelineOfPhase(phase numaflowv1.PipelinePhase) *numaflowv1.Pipeline

func CreateDeploymentInK8S

func CreateDeploymentInK8S(ctx context.Context, t *testing.T, k8sClientSet *k8sclientgo.Clientset, deployment *appsv1.Deployment)

func CreateISBServiceRollout added in v0.11.0

func CreateISBServiceRollout(isbsvcSpec numaflowv1.InterStepBufferServiceSpec) *apiv1.ISBServiceRollout

func CreateISBServiceRolloutInK8S added in v0.11.0

func CreateISBServiceRolloutInK8S(ctx context.Context, t *testing.T, numaplaneClient client.Client, isbsvcRollout *apiv1.ISBServiceRollout)

func CreateISBSvcInK8S

func CreateISBSvcInK8S(ctx context.Context, t *testing.T, numaflowClientSet *numaflowversioned.Clientset, isbsvc *numaflowv1.InterStepBufferService)

func CreateMVRolloutInK8S added in v0.10.0

func CreateMVRolloutInK8S(ctx context.Context, t *testing.T, numaplaneClient client.Client, monoVertexRollout *apiv1.MonoVertexRollout)

func CreateMonoVertexInK8S added in v0.10.0

func CreateMonoVertexInK8S(ctx context.Context, t *testing.T, numaflowClientSet *numaflowversioned.Clientset, monoVertex *numaflowv1.MonoVertex)

func CreateNumaflowControllerInK8S added in v0.10.0

func CreateNumaflowControllerInK8S(ctx context.Context, t *testing.T, numaplaneClient client.Client, numaflowController *apiv1.NumaflowController)

func CreatePipelineInK8S

func CreatePipelineInK8S(ctx context.Context, t *testing.T, numaflowClientSet *numaflowversioned.Clientset, pipeline *numaflowv1.Pipeline)

func CreatePipelineRolloutInK8S

func CreatePipelineRolloutInK8S(ctx context.Context, t *testing.T, numaplaneClient client.Client, pipelineRollout *apiv1.PipelineRollout)

func CreateStatefulSetInK8S

func CreateStatefulSetInK8S(ctx context.Context, t *testing.T, k8sClientSet *k8sclientgo.Clientset, statefulSet *appsv1.StatefulSet)

func CreateTestMVRollout added in v0.10.0

func CreateTestMVRollout(mvSpec numaflowv1.MonoVertexSpec, rolloutAnnotations map[string]string, rolloutLabels map[string]string, mvAnnotations map[string]string, mvLabels map[string]string) *apiv1.MonoVertexRollout

func CreateTestMonoVertexOfSpec added in v0.10.0

func CreateTestMonoVertexOfSpec(
	spec numaflowv1.MonoVertexSpec,
	name string,
	phase numaflowv1.MonoVertexPhase,
	status numaflowv1.Status,
	labels map[string]string,
	annotations map[string]string,
) *numaflowv1.MonoVertex

func CreateTestPipelineOfSpec

func CreateTestPipelineOfSpec(
	spec numaflowv1.PipelineSpec,
	name string,
	phase numaflowv1.PipelinePhase,
	status numaflowv1.Status,
	drainedOnPause bool,
	labels map[string]string,
	annotations map[string]string,
) *numaflowv1.Pipeline

func CreateTestPipelineRollout

func CreateTestPipelineRollout(pipelineSpec numaflowv1.PipelineSpec, rolloutAnnotations map[string]string, rolloutLabels map[string]string, pipelineAnnotations map[string]string, pipelineLabels map[string]string) *apiv1.PipelineRollout

func GetNumaflowControllerDefinitions

func GetNumaflowControllerDefinitions(definitionsFile string) (*config.NumaflowControllerDefinitionConfig, error)

func GetRolloutParentName

func GetRolloutParentName(childName string) (string, error)

assume child name is "<rolloutname>-<number>"

func VerifyAutoHealing

func VerifyAutoHealing(ctx context.Context, gvk schema.GroupVersionKind, namespace string, resourceName string, pathToValue string, newValue any)

VerifyAutoHealing tests the auto healing feature

func VerifyStatusPhase

func VerifyStatusPhase(ctx context.Context, gvk schema.GroupVersionKind, namespace string, resourceName string, desiredPhase apiv1.Phase)

Types

type InProgressStrategyMgr

type InProgressStrategyMgr struct {
	Store *inProgressStrategyStore
	// contains filtered or unexported fields
}

InProgressStrategyMgr is responsible to maintain a Rollout's inProgressStrategy state is maintained both in memory as well as in the Rollout's Status in memory always gives us the latest state in case the Informer cache is out of date the Rollout's Status is useful as a backup mechanism in case Numaplane has just restarted

func NewInProgressStrategyMgr

func NewInProgressStrategyMgr(
	getRolloutStrategy func(context.Context, client.Object) *apiv1.UpgradeStrategy,
	setRolloutStrategy func(context.Context, client.Object, apiv1.UpgradeStrategy)) *InProgressStrategyMgr

func (*InProgressStrategyMgr) GetStrategy

func (mgr *InProgressStrategyMgr) GetStrategy(ctx context.Context, rollout client.Object) apiv1.UpgradeStrategy

func (*InProgressStrategyMgr) SetStrategy

func (mgr *InProgressStrategyMgr) SetStrategy(ctx context.Context, rollout client.Object, upgradeStrategy apiv1.UpgradeStrategy)

store in both memory and the Resource itself

func (*InProgressStrategyMgr) UnsetStrategy

func (mgr *InProgressStrategyMgr) UnsetStrategy(ctx context.Context, rollout client.Object)

type RolloutObject

type RolloutObject interface {
	GetRolloutGVR() metav1.GroupVersionResource

	GetRolloutGVK() schema.GroupVersionKind

	GetChildGVR() metav1.GroupVersionResource

	GetChildGVK() schema.GroupVersionKind

	GetRolloutObjectMeta() *metav1.ObjectMeta

	GetRolloutStatus() *apiv1.Status
}

type TypedGenerationChangedPredicate added in v0.11.0

type TypedGenerationChangedPredicate[object metav1.Object] struct {
	// Returns true by default for all events; see overrides below.
	predicate.TypedFuncs[object]
}

func (TypedGenerationChangedPredicate[object]) Update added in v0.11.0

func (p TypedGenerationChangedPredicate[object]) Update(e event.TypedUpdateEvent[object]) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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