trace

package
v1.0.0-beta.19 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 73 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeCaptureStore

type ChangeCaptureStore interface {
	Load(objects ...client.Object) error
	Insert(object client.Object) error
	Update(object client.Object) error
	Delete(object client.Object) error
	Get(objectRef *model.GVKNObjKey) client.Object
	List(gvk *schema.GroupVersionKind) []client.Object
	GetAll() map[model.GVKNObjKey]client.Object
	GetChanges() []tracev1.ObjectChange
}

type FieldPath

type FieldPath struct {
	// Path of the field.
	//
	Path string `json:"path"`
}

FieldPath defines a field path.

type I18nResourcesManager

type I18nResourcesManager interface {
	ParseRaw(*corev1.ConfigMap) error
	GetFormatString(key string, locale string) string
}

type InformerManager

type InformerManager interface {
	Start(context.Context) error
}

func NewInformerManager

func NewInformerManager(cli client.Client, cache cache.Cache, scheme *runtime.Scheme, eventChan chan event.GenericEvent) InformerManager

type ObjectRevisionStore

type ObjectRevisionStore interface {
	Insert(object, reference client.Object) error
	Get(objectRef *model.GVKNObjKey, revision int64) (client.Object, error)
	List(gvk *schema.GroupVersionKind) map[types.NamespacedName]map[int64]client.Object
	Delete(objectRef *model.GVKNObjKey, reference client.Object, revision int64)
}

ObjectRevisionStore defines an object store which can get the history revision. WARN: This store is designed only for Reconciliation Trace Controller, it's not thread-safe, it doesn't do a deep copy before returning the object. Don't use it in other place.

func NewObjectStore

func NewObjectStore(scheme *runtime.Scheme) ObjectRevisionStore

type ObjectTreeRootFinder

type ObjectTreeRootFinder interface {
	GetEventChannel() chan event.GenericEvent
	GetEventHandler() handler.EventHandler
}

func NewObjectTreeRootFinder

func NewObjectTreeRootFinder(cli client.Client) ObjectTreeRootFinder

type OwnedResource

type OwnedResource struct {
	// Secondary specifies the secondary object type.
	//
	Secondary tracev1.ObjectType `json:"secondary"`

	// Criteria specifies the ownership criteria with its primary resource.
	//
	Criteria OwnershipCriteria `json:"criteria"`
}

OwnedResource defines a secondary resource and the ownership criteria between its primary resource.

type OwnershipCriteria

type OwnershipCriteria struct {
	// SelectorCriteria specifies the selector field path in the primary object.
	// For example, if the StatefulSet is the primary resource, selector will be "spec.selector".
	// The selector field should be a map[string]string
	// or LabelSelector (https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/label-selector/#LabelSelector)
	//
	// +optional
	SelectorCriteria *FieldPath `json:"selectorCriteria,omitempty"`

	// LabelCriteria specifies the labels used to select the secondary objects.
	// The value of each k-v pair can contain placeholder that will be replaced by the ReconciliationTrace Controller.
	// Placeholder is formatted as "$(PLACEHOLDER)".
	// Currently supported PLACEHOLDER:
	// primary - same value as the primary object label with same key.
	// primary.name - the name of the primary object.
	//
	// +optional
	LabelCriteria map[string]string `json:"labelCriteria,omitempty"`

	// SpecifiedNameCriteria specifies the field from which to retrieve the secondary object name.
	//
	// +optional
	SpecifiedNameCriteria *FieldPath `json:"specifiedNameCriteria,omitempty"`

	// Validation specifies the method to validate the OwnerReference of secondary resources.
	//
	// +kubebuilder:validation:Enum={Controller, Owner, None}
	// +kubebuilder:default=Controller
	// +optional
	Validation ValidationType `json:"validation,omitempty"`
}

OwnershipCriteria defines an ownership criteria. Only one of SelectorCriteria, LabelCriteria or BuiltinRelationshipCriteria should be configured.

type OwnershipRule

type OwnershipRule struct {
	// Primary specifies the primary object type.
	//
	Primary tracev1.ObjectType `json:"primary"`

	// OwnedResources specifies all the secondary resources of Primary.
	//
	OwnedResources []OwnedResource `json:"ownedResources"`
}

OwnershipRule defines an ownership rule between primary resource and its secondary resources.

type PlanGenerator

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

type ReconcilerTree

type ReconcilerTree interface {
	Run() error
}

type ReconciliationTraceReconciler

type ReconciliationTraceReconciler struct {
	client.Client
	Scheme               *runtime.Scheme
	Recorder             record.EventRecorder
	ObjectRevisionStore  ObjectRevisionStore
	ObjectTreeRootFinder ObjectTreeRootFinder
	InformerManager      InformerManager
}

ReconciliationTraceReconciler reconciles a ReconciliationTrace object

func (*ReconciliationTraceReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*ReconciliationTraceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ValidationType

type ValidationType string

ValidationType specifies the method to validate the OwnerReference of secondary resources.

const (
	// ControllerValidation requires the secondary resource to have the primary resource
	// in its OwnerReference with controller set to true.
	ControllerValidation ValidationType = "Controller"

	// OwnerValidation requires the secondary resource to have the primary resource
	// in its OwnerReference.
	OwnerValidation ValidationType = "Owner"

	// NoValidation means no validation is performed on the OwnerReference.
	NoValidation ValidationType = "None"
)

Jump to

Keyboard shortcuts

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