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 InformerManager ¶
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 ¶
func (r *ReconciliationTraceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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" )
Source Files ¶
- change_capture_store.go
- current_state_handler.go
- deletion_handler.go
- desired_state_handler.go
- dry_run_handler.go
- finalizer_handler.go
- i18n_resources_manager.go
- informer_manager.go
- mock_client.go
- mock_event_recorder.go
- object_revision_store.go
- object_tree_root_finder.go
- plan_generator.go
- reconciler_tree.go
- reconciliationtrace_controller.go
- resources_loader.go
- resources_validator.go
- type.go
- util.go