base

package
v0.0.0-...-3f6117e Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FinalizerName string

Functions

func DefaultConfigInit

func DefaultConfigInit(config configv1.StreamControllerConfig)

Types

type ResourceDefaulter

type ResourceDefaulter interface {
	Default(c StepObject)
}

type ResourceValidator

type ResourceValidator interface {
	ValidateCreate(c StepObject) field.ErrorList
	ValidateUpdate(now StepObject, old StepObject) field.ErrorList
}

type StatusDeepEqualFunc

type StatusDeepEqualFunc func(new StepObject, old runtime.Object) bool

type Step

type Step struct {
	Name string
	Sub  []*Step

	GetObj func() StepObject
	Render func(c StepObject) (StepObject, error)
	//设置cluster的status,对比子资源目标和现在的声明情况
	SetStatus func(c StepObject, target, now StepObject) (needUpdate bool, updateObject StepObject, err error)
	Del       func(ctx context.Context, c StepObject, client client.Client) error
	Next      func(ctx *StepContext) (bool, error)

	SetDefault         func(c StepObject)
	ValidateCreateStep func(c StepObject) field.ErrorList
	ValidateUpdateStep func(now StepObject, old StepObject) field.ErrorList
}

func (*Step) Default

func (m *Step) Default(c StepObject)

func (*Step) Delete

func (m *Step) Delete(ctx *StepContext) error

func (*Step) Ready

func (m *Step) Ready(ctx *StepContext) (bool, error)

func (*Step) Reconcile

func (m *Step) Reconcile(ctx *StepContext) error

func (*Step) ValidateCreate

func (m *Step) ValidateCreate(c StepObject) field.ErrorList

func (*Step) ValidateUpdate

func (m *Step) ValidateUpdate(now StepObject, old StepObject) field.ErrorList

type StepContext

type StepContext struct {
	context.Context
	StepObject
	logr.Logger
	StepReconcile
	// contains filtered or unexported fields
}

func NewStepContext

func NewStepContext(context context.Context, logger logr.Logger, r StepReconcile, deepEqualFunc StatusDeepEqualFunc) *StepContext

func (*StepContext) Reconcile

func (c *StepContext) Reconcile(name types.NamespacedName, object StepObject, steps []*Step) (ctrl.Result, error)

type StepObject

type StepObject interface {
	runtime.Object
	metav1.Object
	metav1.ObjectMetaAccessor
}

type StepReconcile

type StepReconcile interface {
	GetClient() client.Client
	GetScheme() *runtime.Scheme
	GetRecorder() record.EventRecorder
}

Jump to

Keyboard shortcuts

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