pipeline

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteProtectionAnnotation = "syn.tools/protected-delete"
)

Variables

This section is empty.

Functions

func GetDefaultDeletionPolicy

func GetDefaultDeletionPolicy() synv1alpha1.DeletionPolicy

Types

type Context

type Context struct {
	Context       context.Context
	FinalizerName string
	Client        client.Client
	Log           logr.Logger
	Deleted       bool

	Reconciler            reconcile.Reconciler
	CreateSATokenSecret   bool
	DefaultCreationPolicy synv1alpha1.CreationPolicy
	// contains filtered or unexported fields
}

Context contains additional data about the CRD being processed.

type Function

type Function func(Object, *Context) Result

Function defines the general form of a pipeline function.

type Object

type Object interface {
	client.Object

	GetGitTemplate() *synv1alpha1.GitRepoTemplate
	GroupVersionKind() schema.GroupVersionKind
	GetTenantRef() corev1.LocalObjectReference
	GetDeletionPolicy() synv1alpha1.DeletionPolicy
	GetCreationPolicy() synv1alpha1.CreationPolicy
	GetDisplayName() string
	SetGitRepoURLAndHostKeys(URL, hostKeys string)
	GetMeta() metav1.ObjectMeta
	GetSpec() interface{}
	GetStatus() interface{}
}

Object defines an interface to extract necessary information from the CRs

type Result

type Result struct {
	Abort   bool
	Err     error
	Requeue bool
}

Result indicates whether the current execution should be aborted and if there was an error.

func AddTenantLabel

func AddTenantLabel(obj Object, _ *Context) Result

AddTenantLabel adds the tenant label to an object.

func CheckIfDeleted

func CheckIfDeleted(obj Object, data *Context) Result

func Common

func Common(obj Object, data *Context) Result

func DeepCopyOriginal

func DeepCopyOriginal(obj Object, data *Context) Result

func RunPipeline

func RunPipeline(obj Object, data *Context, steps []Step) Result

type Step

type Step struct {
	Name string
	F    Function
}

Jump to

Keyboard shortcuts

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