pipelines

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventReasons = struct {
	Syncing    string
	Synced     string
	SyncFailed string
}{
	Syncing:    "Syncing",
	Synced:     "Synced",
	SyncFailed: "SyncFailed",
}
View Source
var EventTypes = struct {
	Normal  string
	Warning string
}{
	Warning: "Warning",
	Normal:  "Normal",
}
View Source
var LogKeys = struct {
	Workflow  string
	Command   string
	Duration  string
	Status    string
	OldStatus string
	NewStatus string
}{
	Workflow:  "workflow",
	Command:   "command",
	Duration:  "duration",
	Status:    "status",
	OldStatus: "oldStatus",
	NewStatus: "newStatus",
}
View Source
var RunConfigurationConstants = struct {
	RunConfigurationNameLabelKey string
}{
	RunConfigurationNameLabelKey: apis.Group + "/runconfiguration.name",
}
View Source
var StateHandlerConstants = struct {
	ProviderChangedError string
}{
	ProviderChangedError: "the provider has changed",
}
View Source
var WorkflowConstants = struct {
	OwnerKindLabelKey               string
	OwnerNameLabelKey               string
	OwnerNamespaceLabelKey          string
	ConstructionFailedError         string
	ProviderNameParameterName       string
	ProviderOutputParameterName     string
	ResourceKindParameterName       string
	ResourceDefinitionParameterName string
	ResourceIdParameterName         string
}{
	OwnerKindLabelKey:               apis.Group + "/owner.kind",
	OwnerNameLabelKey:               apis.Group + "/owner.name",
	OwnerNamespaceLabelKey:          apis.Group + "/owner.namespace",
	ConstructionFailedError:         "error constructing workflow",
	ProviderNameParameterName:       "provider-name",
	ProviderOutputParameterName:     "provider-output",
	ResourceKindParameterName:       "resource-kind",
	ResourceDefinitionParameterName: "resource-definition",
	ResourceIdParameterName:         "resource-id",
}
View Source
var WorkflowRepositoryConstants = struct {
	WorkflowProcessedLabel string
}{
	WorkflowProcessedLabel: pipelinesv1.GroupVersion.Group + "/processed",
}

Functions

func CommonWorkflowLabels added in v0.1.0

func CommonWorkflowLabels(owner pipelinesv1.Resource) map[string]string

func NamedValuesToMap added in v0.2.0

func NamedValuesToMap(namedValues []apis.NamedValue) map[string]string

func NamedValuesToMultiMap added in v0.2.0

func NamedValuesToMultiMap(namedValues []apis.NamedValue) map[string][]string

Types

type AcquireResource added in v0.0.3

type AcquireResource struct {
}

type Command

type Command interface {
	// contains filtered or unexported methods
}

type CreateWorkflow

type CreateWorkflow struct {
	Workflow argo.Workflow
}

type DependingOnPipelineReconciler added in v0.3.0

type DependingOnPipelineReconciler[R DependingOnPipelineResource] struct {
	EC K8sExecutionContext
}

type DependingOnPipelineResource added in v0.3.0

type DependingOnPipelineResource interface {
	client.Object
	GetPipeline() pipelinesv1.PipelineIdentifier
	GetObservedPipelineVersion() string
	SetObservedPipelineVersion(string)
}

type DependingOnRunConfigurationReconciler added in v0.4.0

type DependingOnRunConfigurationReconciler[R DependingOnRunConfigurationResource] struct {
	EC K8sExecutionContext
}

type DependingOnRunConfigurationResource added in v0.4.0

type DependingOnRunConfigurationResource interface {
	client.Object
	GetReferencedRCs() []string
	GetReferencedRCArtifacts() []pipelinesv1.RunConfigurationRef
	GetDependencyRuns() map[string]pipelinesv1.RunReference
	SetDependencyRuns(map[string]pipelinesv1.RunReference)
}

type ExperimentDefinitionCreator added in v0.3.0

type ExperimentDefinitionCreator struct {
	Config config.Configuration
}

type ExperimentReconciler added in v0.0.3

type ExperimentReconciler struct {
	StateHandler[*pipelinesv1.Experiment]
	ResourceReconciler[*pipelinesv1.Experiment]
}

ExperimentReconciler reconciles a Experiment object

func NewExperimentReconciler added in v0.4.0

func NewExperimentReconciler(ec K8sExecutionContext, workflowRepository WorkflowRepository, config config.Configuration) *ExperimentReconciler

func (*ExperimentReconciler) Reconcile added in v0.0.3

func (r *ExperimentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ExperimentReconciler) SetupWithManager added in v0.0.3

func (r *ExperimentReconciler) SetupWithManager(mgr ctrl.Manager) error

type IdVerifier added in v0.3.0

type IdVerifier struct {
	SuccessState apis.SynchronizationState
	FailureState apis.SynchronizationState
	VerifyId     func(string) error
}

type K8sExecutionContext added in v0.0.3

type K8sExecutionContext struct {
	Client             controllers.OptInClient
	Recorder           record.EventRecorder
	Scheme             *runtime.Scheme
	WorkflowRepository WorkflowRepository
}

type MarkWorkflowsAsProcessed added in v0.3.0

type MarkWorkflowsAsProcessed struct {
	Workflows []argo.Workflow
}

type PipelineDefinitionCreator added in v0.3.0

type PipelineDefinitionCreator struct {
	Config config.Configuration
}

type PipelineReconciler

type PipelineReconciler struct {
	StateHandler[*pipelinesv1.Pipeline]
	ResourceReconciler[*pipelinesv1.Pipeline]
}

func NewPipelineReconciler added in v0.4.0

func NewPipelineReconciler(ec K8sExecutionContext, workflowRepository WorkflowRepository, config config.Configuration) *PipelineReconciler

func (*PipelineReconciler) Reconcile

func (r *PipelineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*PipelineReconciler) SetupWithManager

func (r *PipelineReconciler) SetupWithManager(mgr ctrl.Manager) error

type ReleaseResource added in v0.0.3

type ReleaseResource struct {
}

type ResourceReconciler added in v0.4.0

type ResourceReconciler[R pipelinesv1.Resource] struct {
	EC     K8sExecutionContext
	Config config.Configuration
}

type ResourceWorkflowFactory added in v0.3.0

type ResourceWorkflowFactory[R pipelinesv1.Resource, ResourceDefinition any] struct {
	Config                config.Configuration
	TemplateNameGenerator TemplateNameGenerator
	DefinitionCreator     func(R) (ResourceDefinition, error)
}

func RunWorkflowFactory added in v0.3.0

func (ResourceWorkflowFactory[R, ResourceDefinition]) CommonWorkflowMeta added in v0.3.0

func (workflows ResourceWorkflowFactory[R, ResourceDefinition]) CommonWorkflowMeta(owner pipelinesv1.Resource) *metav1.ObjectMeta

func (*ResourceWorkflowFactory[R, ResourceDefinition]) ConstructCreationWorkflow added in v0.3.0

func (workflows *ResourceWorkflowFactory[R, ResourceDefinition]) ConstructCreationWorkflow(provider string, resource R) (*argo.Workflow, error)

func (*ResourceWorkflowFactory[R, ResourceDefinition]) ConstructDeletionWorkflow added in v0.3.0

func (workflows *ResourceWorkflowFactory[R, ResourceDefinition]) ConstructDeletionWorkflow(provider string, resource R) (*argo.Workflow, error)

func (*ResourceWorkflowFactory[R, ResourceDefinition]) ConstructUpdateWorkflow added in v0.3.0

func (workflows *ResourceWorkflowFactory[R, ResourceDefinition]) ConstructUpdateWorkflow(provider string, resource R) (*argo.Workflow, error)

type RunConfigurationReconciler added in v0.0.2

RunConfigurationReconciler reconciles a RunConfiguration object

func NewRunConfigurationReconciler added in v0.4.0

func NewRunConfigurationReconciler(ec K8sExecutionContext, scheme *runtime.Scheme, config config.Configuration) *RunConfigurationReconciler

func (*RunConfigurationReconciler) Reconcile added in v0.0.2

func (*RunConfigurationReconciler) SetupWithManager added in v0.0.2

func (r *RunConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error

type RunDefinitionCreator added in v0.3.0

type RunDefinitionCreator struct {
	Config config.Configuration
}

type RunReconciler added in v0.3.0

RunReconciler reconciles a Run object

func NewRunReconciler added in v0.4.0

func NewRunReconciler(ec K8sExecutionContext, workflowRepository WorkflowRepository, config config.Configuration) *RunReconciler

func (*RunReconciler) Reconcile added in v0.3.0

func (r *RunReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*RunReconciler) SetupWithManager added in v0.3.0

func (r *RunReconciler) SetupWithManager(mgr ctrl.Manager) error

type RunScheduleDefinitionCreator added in v0.4.0

type RunScheduleDefinitionCreator struct {
	Config config.Configuration
}

type RunScheduleReconciler added in v0.4.0

RunScheduleReconciler reconciles a RunSchedule object

func NewRunScheduleReconciler added in v0.4.0

func NewRunScheduleReconciler(ec K8sExecutionContext, workflowRepository WorkflowRepository, config config.Configuration) *RunScheduleReconciler

func (*RunScheduleReconciler) Reconcile added in v0.4.0

func (r *RunScheduleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*RunScheduleReconciler) SetupWithManager added in v0.4.0

func (r *RunScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error

type SetStatus added in v0.0.3

type SetStatus struct {
	Message string
	Status  pipelinesv1.Status
}

func From added in v0.0.3

func From(status pipelinesv1.Status) *SetStatus

func NewSetStatus added in v0.0.3

func NewSetStatus() *SetStatus

func (*SetStatus) WithMessage added in v0.0.3

func (sps *SetStatus) WithMessage(message string) *SetStatus

func (*SetStatus) WithProviderId added in v0.3.0

func (sps *SetStatus) WithProviderId(providerId pipelinesv1.ProviderAndId) *SetStatus

func (*SetStatus) WithSynchronizationState added in v0.0.3

func (sps *SetStatus) WithSynchronizationState(state apis.SynchronizationState) *SetStatus

func (*SetStatus) WithVersion added in v0.0.3

func (sps *SetStatus) WithVersion(version string) *SetStatus

type StateHandler

type StateHandler[R pipelinesv1.Resource] struct {
	WorkflowFactory    WorkflowFactory[R]
	WorkflowRepository WorkflowRepository
}

func (*StateHandler[R]) StateTransition

func (st *StateHandler[R]) StateTransition(ctx context.Context, provider string, resource R) []Command

type SuffixedTemplateNameGenerator added in v0.3.0

type SuffixedTemplateNameGenerator struct {
	// contains filtered or unexported fields
}

func (SuffixedTemplateNameGenerator) CreateTemplate added in v0.3.0

func (ctng SuffixedTemplateNameGenerator) CreateTemplate() string

func (SuffixedTemplateNameGenerator) DeleteTemplate added in v0.3.0

func (ctng SuffixedTemplateNameGenerator) DeleteTemplate() string

func (SuffixedTemplateNameGenerator) UpdateTemplate added in v0.3.0

func (ctng SuffixedTemplateNameGenerator) UpdateTemplate() string

type TemplateNameGenerator added in v0.3.0

type TemplateNameGenerator interface {
	CreateTemplate() string
	UpdateTemplate() string
	DeleteTemplate() string
}

func CompiledTemplateNameGenerator added in v0.3.0

func CompiledTemplateNameGenerator(config config.Configuration) TemplateNameGenerator

func SimpleTemplateNameGenerator added in v0.3.0

func SimpleTemplateNameGenerator(config config.Configuration) TemplateNameGenerator

type WorkflowFactory

type WorkflowFactory[R pipelinesv1.Resource] interface {
	ConstructCreationWorkflow(provider string, resource R) (*argo.Workflow, error)
	ConstructUpdateWorkflow(provider string, resource R) (*argo.Workflow, error)
	ConstructDeletionWorkflow(provider string, resource R) (*argo.Workflow, error)
}

type WorkflowRepository

type WorkflowRepository interface {
	CreateWorkflowForResource(ctx context.Context, workflow *argo.Workflow, resource pipelinesv1.Resource) error
	GetByLabels(ctx context.Context, matchingLabels map[string]string) []argo.Workflow
	MarkWorkflowAsProcessed(ctx context.Context, workflow *argo.Workflow) error
}

type WorkflowRepositoryImpl

type WorkflowRepositoryImpl struct {
	Client controllers.OptInClient
	Config config.Configuration
	Scheme *runtime.Scheme
}

func (WorkflowRepositoryImpl) CreateWorkflowForResource added in v0.0.3

func (w WorkflowRepositoryImpl) CreateWorkflowForResource(ctx context.Context, workflow *argo.Workflow, resource pipelinesv1.Resource) error

func (WorkflowRepositoryImpl) GetByLabels added in v0.0.3

func (w WorkflowRepositoryImpl) GetByLabels(ctx context.Context, matchingLabels map[string]string) []argo.Workflow

func (WorkflowRepositoryImpl) MarkWorkflowAsProcessed added in v0.3.0

func (w WorkflowRepositoryImpl) MarkWorkflowAsProcessed(ctx context.Context, workflow *argo.Workflow) error

Jump to

Keyboard shortcuts

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