Documentation ¶
Index ¶
Constants ¶
const (
ReconcileWait string = "RECONCILE_WAIT"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonPredicates ¶
CommonPredicates struct holds the fields to initalise common predicate methods.
func (*CommonPredicates) IgnoreNamespacePredicate ¶
func (c *CommonPredicates) IgnoreNamespacePredicate(obj client.Object) bool
IgnoreNamespacePredicate is a function that, when initialized within the create and update predicates, filters out the namespaces that should NOT be reconciled in the DENY_LIST. This function is particularly useful in scenarios where the controller watches all the namespaces but wants to exclude certain ones, such as kube-system and default. By using the DENY_LIST feature, the controller can ensure that the excluded namespaces are not processed during the reconciliation process, thus reducing unnecessary overhead.
Controllers can watch a single namespace, multiple namespaces, or all namespaces. When the IgnoreNamespacePredicate function is used, it allows the controller to further refine which namespaces are processed. This function should be called within the create and update predicates to ensure that the namespaces are properly filtered before reconciliation takes place.
func (*CommonPredicates) IgnoreObjectPredicate ¶
func (c *CommonPredicates) IgnoreObjectPredicate(obj client.Object) bool
IgnoreIgnoredObjectPredicate is a function that, when initialized within the create or update predicate, filters out the namespaces that have an ignore annotation present. This function is particularly useful when a controller is reconciling multiple, all, or a single custom resource. In such scenarios, the controller may need to pause reconciliation on a specific custom resource. By using this function, the controller can filter out the namespaces with the ignore annotation.
This function should be called within the create or update predicate to ensure that the namespaces with the ignore annotation are properly filtered before reconciliation takes place.
func (*CommonPredicates) IgnoreUpdate ¶
func (c *CommonPredicates) IgnoreUpdate(e event.UpdateEvent) bool
IgnoreUpdate to ignore the Update events when nothing has changed in the resource version
type ConfigMapHash ¶
type HashHolder ¶
func MakeConfigMapHash ¶
func MakeConfigMapHash(configHash []ConfigMapHash) ([]HashHolder, error)
type Predicates ¶
type Predicates interface { IgnoreNamespacePredicate(obj client.Object) bool IgnoreObjectPredicate(obj client.Object) bool IgnoreUpdate(e event.UpdateEvent) bool }
func NewCommonPredicates ¶
func NewCommonPredicates( controllerName, ignoreAnnotation string, log logr.Logger) Predicates
NewCommonPredicates is contstructor for CommonPredicates