model

package
v0.6.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE = Action("CREATE")
	UPDATE = Action("UPDATE")
	DELETE = Action("DELETE")
	STATUS = Action("STATUS")
)
View Source
const (
	AppInstanceLabelKey            = "app.kubernetes.io/instance"
	KBManagedByKey                 = "apps.kubeblocks.io/managed-by"
	RoleLabelKey                   = "kubeblocks.io/role"
	ConsensusSetAccessModeLabelKey = "cs.apps.kubeblocks.io/access-mode"
)

Variables

View Source
var RequeueDuration = time.Millisecond * 100

RequeueDuration default reconcile requeue after duration

Functions

func AddScheme

func AddScheme(addToScheme func(*runtime.Scheme) error)

func DependOn

func DependOn(dag *graph.DAG, object client.Object, dependency ...client.Object)

func FindAll

func FindAll[T interface{}](dag *graph.DAG) []graph.Vertex

func FindAllNot

func FindAllNot[T interface{}](dag *graph.DAG) []graph.Vertex

func GetScheme

func GetScheme() *runtime.Scheme

func IsObjectDeleting

func IsObjectDeleting(object client.Object) bool

func IsObjectStatusUpdating

func IsObjectStatusUpdating(object client.Object) bool

func IsObjectUpdating

func IsObjectUpdating(object client.Object) bool

func IsOwnerOf

func IsOwnerOf(owner, obj client.Object) bool

func NewRequeueError

func NewRequeueError(after time.Duration, reason string) error

func PrepareCreate

func PrepareCreate(dag *graph.DAG, object client.Object)

func PrepareDelete

func PrepareDelete(dag *graph.DAG, object client.Object)

func PrepareRootDelete

func PrepareRootDelete(dag *graph.DAG) error

func PrepareRootStatus

func PrepareRootStatus(dag *graph.DAG) error

func PrepareRootUpdate

func PrepareRootUpdate(dag *graph.DAG) error

func PrepareStatus

func PrepareStatus(dag *graph.DAG, objectOld, objectNew client.Object)

func PrepareUpdate

func PrepareUpdate(dag *graph.DAG, objectOld, objectNew client.Object)

Types

type Action

type Action string

func ActionPtr

func ActionPtr(action Action) *Action

type GVKName

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

func GetGVKName

func GetGVKName(object client.Object) (*GVKName, error)

type ObjectSnapshot

type ObjectSnapshot map[GVKName]client.Object

func ReadCacheSnapshot

func ReadCacheSnapshot(transCtx graph.TransformContext, root client.Object, ml client.MatchingLabels, kinds ...client.ObjectList) (ObjectSnapshot, error)

ReadCacheSnapshot reads all objects owned by our cluster

type ObjectVertex

type ObjectVertex struct {
	Obj       client.Object
	OriObj    client.Object
	Immutable bool
	IsOrphan  bool
	Action    *Action
}

ObjectVertex describes expected object spec and how to reach it obj always represents the expected part: new object in Create/Update action and old object in Delete action oriObj is set in Update action all transformers doing their object manipulation works on obj.spec the root vertex(i.e. the cluster vertex) will be treated specially: as all its meta, spec and status can be updated in one reconciliation loop Update is ignored when immutable=true orphan object will be force deleted when action is DELETE

func FindRootVertex

func FindRootVertex(dag *graph.DAG) (*ObjectVertex, error)

func (ObjectVertex) String

func (v ObjectVertex) String() string

type ParallelTransformer

type ParallelTransformer struct {
	Transformers []graph.Transformer
}

func (*ParallelTransformer) Transform

func (t *ParallelTransformer) Transform(ctx graph.TransformContext, dag *graph.DAG) error

type RequeueError

type RequeueError interface {
	RequeueAfter() time.Duration
	Reason() string
}

Jump to

Keyboard shortcuts

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