pipeline

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelOwnedByCapsule = "rig.dev/owned-by-capsule"
)

Variables

View Source
var (
	AppsDeploymentGVK                      = appsv1.SchemeGroupVersion.WithKind("Deployment")
	CoreServiceGVK                         = corev1.SchemeGroupVersion.WithKind("Service")
	CMCertificateGVK                       = cmv1.SchemeGroupVersion.WithKind(cmv1.CertificateKind)
	NetIngressGVK                          = netv1.SchemeGroupVersion.WithKind("Ingress")
	AutoscalingvHorizontalPodAutoscalerGVK = autoscalingv2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler")
	BatchCronJobGVK                        = batchv1.SchemeGroupVersion.WithKind("CronJob")
	MonitoringServiceMonitorGVK            = monitorv1.SchemeGroupVersion.WithKind(monitorv1.ServiceMonitorsKind)
	VPAVerticalPodAutoscalerGVK            = vpav1.SchemeGroupVersion.WithKind("VerticalPodAutoscaler")
	CoreServiceAccount                     = corev1.SchemeGroupVersion.WithKind("ServiceAccount")
)

Functions

func IsOwnedBy

func IsOwnedBy(owner metav1.Object, obj metav1.Object) bool

func ObjectsEquals

func ObjectsEquals(o1, o2 client.Object) bool

Types

type CapsuleRequest

type CapsuleRequest interface {
	Scheme() *runtime.Scheme
	Reader() client.Reader
	Capsule() *v1alpha2.Capsule
	GetCurrent(obj client.Object) error
	GetNew(obj client.Object) error
	Set(obj client.Object) error
	Delete(obj client.Object) error
	MarkUsedResource(res v1alpha2.UsedResource)
}

func NewCapsuleRequest

func NewCapsuleRequest(p *Pipeline, capsule *v1alpha2.Capsule, opts ...CapsuleRequestOption) CapsuleRequest

type CapsuleRequestOption

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

func WithDryRun

func WithDryRun() CapsuleRequestOption

func WithForce

func WithForce() CapsuleRequestOption

type Object

type Object struct {
	Current      client.Object
	New          client.Object
	Materialized client.Object
}

type ObjectsEqual

type ObjectsEqual func(o1, o2 client.Object) bool

type OutputObject

type OutputObject struct {
	ObjectKey objectKey
	Object    client.Object
	State     ResourceState
}

type Pipeline

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

func New

func New(
	cc client.Client,
	cr client.Reader,
	config *configv1alpha1.OperatorConfig,
	scheme *runtime.Scheme,
	logger logr.Logger,
) *Pipeline

func (*Pipeline) AddStep

func (p *Pipeline) AddStep(step Step)

func (*Pipeline) RunCapsule

func (p *Pipeline) RunCapsule(
	ctx context.Context,
	capsule *v1alpha2.Capsule,
	opts ...CapsuleRequestOption,
) (*Result, error)

func (*Pipeline) RunSteps

func (p *Pipeline) RunSteps(ctx context.Context, capReq CapsuleRequest, commit bool) (*Result, error)

type ResourceState

type ResourceState string
const (
	ResourceStateDeleted       ResourceState = "deleted"
	ResourceStateUpdated       ResourceState = "updated"
	ResourceStateUnchanged     ResourceState = "unchanged"
	ResourceStateCreated       ResourceState = "created"
	ResourceStateFailed        ResourceState = "failed"
	ResourceStateAlreadyExists ResourceState = "alreadyExists"
	ResourceStateChangePending ResourceState = "changePending"
)

type Result

type Result struct {
	InputObjects  []client.Object
	OutputObjects []OutputObject
	Objects       []*Object
}

type Step

type Step interface {
	Apply(ctx context.Context, req CapsuleRequest) error
}

Jump to

Keyboard shortcuts

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