Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ClusterCollectorDeploymentPredicate = ObjectNamePredicate{ AllowedObjectName: odigosk8sconsts.OdigosClusterCollectorDeploymentName, }
this predicate will only allow events for the odigos cluster collectors daemon set object. this is useful if you only want to reconcile events for the cluster collectors daemon set object and ignore other daemon set objects.
var NodeCollectorsDaemonSetPredicate = ObjectNamePredicate{ AllowedObjectName: odigosk8sconsts.OdigosNodeCollectorDaemonSetName, }
this predicate will only allow events for the odigos node collectors daemon set object. this is useful if you only want to reconcile events for the node collectors daemon set object and ignore other daemon set objects.
var OdigosCollectorsGroupClusterPredicate = ObjectNamePredicate{ AllowedObjectName: odigosk8sconsts.OdigosClusterCollectorCollectorGroupName, }
use this event filter to reconcile only collectors group events for cluster collectors group objects this is useful if you reconcile only depends on changes from the cluster collectors group and should not react to node collectors group changes example usage: import odigospredicates "github.com/odigos-io/odigos/k8sutils/pkg/predicate" ...
err = ctrl.NewControllerManagedBy(mgr). For(&odigosv1.CollectorsGroup{}). WithEventFilter(&odigospredicates.OdigosCollectorsGroupClusterPredicate). Complete(r)
var OdigosCollectorsGroupNodePredicate = ObjectNamePredicate{ AllowedObjectName: odigosk8sconsts.OdigosNodeCollectorCollectorGroupName, }
use this event filter to reconcile only collectors group events for node collectors group objects this is useful if you reconcile only depends on changes from the node collectors group and should not react to cluster collectors group changes example usage: import odigospredicates "github.com/odigos-io/odigos/k8sutils/pkg/predicate" ...
err = ctrl.NewControllerManagedBy(mgr). For(&odigosv1.CollectorsGroup{}). WithEventFilter(&odigospredicates.OdigosCollectorsGroupCluster). Complete(r)
var OdigosConfigMapPredicate = ObjectNamePredicate{ AllowedObjectName: consts.OdigosConfigurationName, }
This predicate will only allow config map events on the "odigos-config" object, and will filter out events for possible other config maps which the reconciler should not handle. Example usage: import odigospredicates "github.com/odigos-io/odigos/k8sutils/pkg/predicate" ...
err = ctrl.NewControllerManagedBy(mgr). For(&corev1.ConfigMap{}). WithEventFilter(&odigospredicates.OdigosConfigMapPredicate). Complete(r)
Functions ¶
This section is empty.
Types ¶
type AllContainersReadyPredicate ¶ added in v1.0.123
type AllContainersReadyPredicate struct{}
AllContainersReadyPredicate is a predicate that checks if all containers in a pod are ready or becoming ready.
For Create events, it returns true if the pod is in Running phase and all containers are ready. For Update events, it returns true if the new pod has all containers ready and started, and the old pod had at least one container not ready or not started. For Delete events, it returns false.
func (*AllContainersReadyPredicate) Create ¶ added in v1.0.123
func (p *AllContainersReadyPredicate) Create(e event.CreateEvent) bool
func (*AllContainersReadyPredicate) Delete ¶ added in v1.0.123
func (p *AllContainersReadyPredicate) Delete(e event.DeleteEvent) bool
func (*AllContainersReadyPredicate) Generic ¶ added in v1.0.123
func (p *AllContainersReadyPredicate) Generic(e event.GenericEvent) bool
func (*AllContainersReadyPredicate) Update ¶ added in v1.0.123
func (p *AllContainersReadyPredicate) Update(e event.UpdateEvent) bool
type CgBecomesReadyPredicate ¶
type CgBecomesReadyPredicate struct{}
this event filter will only trigger reconciliation when the collectors group was not ready and now it is ready. some controllers in odigos reacts to this specific event, and should not be triggered by other events such as spec updates or status conditions changes. for create events, it will only trigger reconciliation if the collectors group is ready.
func (*CgBecomesReadyPredicate) Create ¶
func (i *CgBecomesReadyPredicate) Create(e event.CreateEvent) bool
func (*CgBecomesReadyPredicate) Delete ¶
func (i *CgBecomesReadyPredicate) Delete(e event.DeleteEvent) bool
func (*CgBecomesReadyPredicate) Generic ¶
func (i *CgBecomesReadyPredicate) Generic(e event.GenericEvent) bool
func (*CgBecomesReadyPredicate) Update ¶
func (i *CgBecomesReadyPredicate) Update(e event.UpdateEvent) bool
type ConfigMapDataChangedPredicate ¶
type ConfigMapDataChangedPredicate struct{}
this event filter will only trigger reconciliation when the configmap data was changed. the reconciled type must be corev1.ConfigMap note: this preidcate currently only check the Data field of the ConfigMap (without BinaryData)
func (ConfigMapDataChangedPredicate) Create ¶
func (o ConfigMapDataChangedPredicate) Create(e event.CreateEvent) bool
func (ConfigMapDataChangedPredicate) Delete ¶
func (i ConfigMapDataChangedPredicate) Delete(e event.DeleteEvent) bool
func (ConfigMapDataChangedPredicate) Generic ¶
func (i ConfigMapDataChangedPredicate) Generic(e event.GenericEvent) bool
func (ConfigMapDataChangedPredicate) Update ¶
func (i ConfigMapDataChangedPredicate) Update(e event.UpdateEvent) bool
type DeletionPredicate ¶ added in v1.0.123
type DeletionPredicate struct{}
DeletionPredicate only allows delete events.
func (DeletionPredicate) Create ¶ added in v1.0.123
func (o DeletionPredicate) Create(e event.CreateEvent) bool
func (DeletionPredicate) Delete ¶ added in v1.0.123
func (i DeletionPredicate) Delete(e event.DeleteEvent) bool
func (DeletionPredicate) Generic ¶ added in v1.0.123
func (i DeletionPredicate) Generic(e event.GenericEvent) bool
func (DeletionPredicate) Update ¶ added in v1.0.123
func (i DeletionPredicate) Update(e event.UpdateEvent) bool
type ExistencePredicate ¶
type ExistencePredicate struct{}
existence predicate only allows create and delete events. it is useful when the controller only reacts to the presence of an object (e.g. if it exists or not), and not to it's content or status changes.
Notice these 2 things when using this predicate: 1. The event filter will allow events for each object on startup, as all the objects are "created" in the cache. 2. If you have important task to do on delete events, make sure it is applied if the event is missed and the controller restarts, since the delete event will not be triggered on controller restart as the object is no longer in k8s.
func (ExistencePredicate) Create ¶
func (o ExistencePredicate) Create(e event.CreateEvent) bool
func (ExistencePredicate) Delete ¶
func (i ExistencePredicate) Delete(e event.DeleteEvent) bool
func (ExistencePredicate) Generic ¶
func (i ExistencePredicate) Generic(e event.GenericEvent) bool
func (ExistencePredicate) Update ¶
func (i ExistencePredicate) Update(e event.UpdateEvent) bool
type ObjectNamePredicate ¶
type ObjectNamePredicate struct {
AllowedObjectName string
}
func (ObjectNamePredicate) Create ¶
func (o ObjectNamePredicate) Create(e event.CreateEvent) bool
func (ObjectNamePredicate) Delete ¶
func (i ObjectNamePredicate) Delete(e event.DeleteEvent) bool
func (ObjectNamePredicate) Generic ¶
func (i ObjectNamePredicate) Generic(e event.GenericEvent) bool
func (ObjectNamePredicate) Update ¶
func (i ObjectNamePredicate) Update(e event.UpdateEvent) bool
type OnlyUpdatesPredicate ¶
type OnlyUpdatesPredicate struct{}
This predicate only allows update events. It is useful if you handle the initial state when the controller starts, and only need to apply changes for example - when monitoring odigos config changes.
func (OnlyUpdatesPredicate) Create ¶
func (o OnlyUpdatesPredicate) Create(e event.CreateEvent) bool
func (OnlyUpdatesPredicate) Delete ¶
func (i OnlyUpdatesPredicate) Delete(e event.DeleteEvent) bool
func (OnlyUpdatesPredicate) Generic ¶
func (i OnlyUpdatesPredicate) Generic(e event.GenericEvent) bool
func (OnlyUpdatesPredicate) Update ¶
func (i OnlyUpdatesPredicate) Update(e event.UpdateEvent) bool