common

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 27 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            = "isbservicerollout-test" // TODO: change to add "-0" suffix after Progressive
	DefaultTestPipelineRolloutName   = "pipelinerollout-test"
	DefaultTestPipelineName          = DefaultTestPipelineRolloutName + "-0"
	DefaultTestNewPipelineName       = DefaultTestPipelineRolloutName + "-1"
	DefaultTestMonoVertexRolloutName = "monovertexrollout-test"
	DefaultTestMonoVertexName        = DefaultTestMonoVertexRolloutName + "-0"
)
View Source
var (
	TestRESTConfig    *rest.Config
	TestK8sClient     client.Client
	TestCustomMetrics *metrics.CustomMetrics
)

Functions

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 CreateISBSvcInK8S

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

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 CreateTestPipelineOfSpec

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

func CreateTestPipelineRollout

func CreateTestPipelineRollout(isbsvcSpec numaflowv1.PipelineSpec, annotations map[string]string, labels 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 {
	GetChildPluralName() string

	GetTypeMeta() *metav1.TypeMeta

	GetObjectMeta() *metav1.ObjectMeta

	GetStatus() *apiv1.Status
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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