Documentation
¶
Index ¶
- Constants
- Variables
- func AdvancedTemplateFuncMap(config *rest.Config, logger logr.Logger) template.FuncMap
- func GetDynamicClientForAPIResource(context context.Context, resource *metav1.APIResource) (dynamic.NamespaceableResourceInterface, error)
- func GetDynamicClientForGVK(context context.Context, gvk schema.GroupVersionKind) (dynamic.NamespaceableResourceInterface, bool, error)
- func GetDynamicClientOnUnstructured(context context.Context, obj *unstructured.Unstructured) (dynamic.ResourceInterface, error)
- func IsDriftDetectionEnabled() bool
- func IsOwner(owner, owned metav1.Object) bool
- func ManageOutcome(context context.Context, r ReconcilerBase, obj client.Object, issue error) (reconcile.Result, error)
- func ManageOutcomeWithRequeue(context context.Context, r ReconcilerBase, obj client.Object, issue error, ...) (reconcile.Result, error)
- func NewLookupFunction(config *rest.Config, logger logr.Logger) lookupFunc
- func SetIndexField(context context.Context, cache cache.Cache, obj client.Object, path string) error
- func SetSyncPeriod(period time.Duration)
- type PeriodicReconcilePredicate
- type ReconcilerBase
- func (r *ReconcilerBase) CreateOrUpdateResource(context context.Context, owner client.Object, namespace string, ...) error
- func (r *ReconcilerBase) DeleteResourceIfExists(context context.Context, obj client.Object) error
- func (r *ReconcilerBase) GetClient() client.Client
- func (r *ReconcilerBase) GetDiscoveryClient() (*discovery.DiscoveryClient, error)
- func (r *ReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ReconcilerBase) GetRestConfig() *rest.Config
- func (r *ReconcilerBase) GetScheme() *runtime.Scheme
- type VaultEngineResource
- type VaultPKIEngineResource
- type VaultResource
Constants ¶
const ReconcileFailed = "ReconcileFailed"
const ReconcileFailedReason = "LastReconcileCycleFailed"
const ReconcileSuccessful = "ReconcileSuccessful"
const ReconcileSuccessfulReason = "LastReconcileCycleSucceded"
Variables ¶
var SyncPeriod time.Duration = 36000 * time.Second // Default to 10 hours
SyncPeriod stores the manager's sync period for use in predicates
Functions ¶
func AdvancedTemplateFuncMap ¶ added in v0.8.20
AdvancedTemplateFuncMap to add Sprig and additional templating functions
func GetDynamicClientForAPIResource ¶ added in v0.8.20
func GetDynamicClientForAPIResource(context context.Context, resource *metav1.APIResource) (dynamic.NamespaceableResourceInterface, error)
GetDynamicClientOnAPIResource returns a dynamic client on an APIResource. This client can be further namespaced. needs context with log and restConfig
func GetDynamicClientForGVK ¶ added in v0.8.20
func GetDynamicClientForGVK(context context.Context, gvk schema.GroupVersionKind) (dynamic.NamespaceableResourceInterface, bool, error)
GetDynamicClientForGVK returns a dynamic client on an gvk type. Also returns whether this reosurce is namespaced. This client can be further namespaced. needs context with log and restConfig
func GetDynamicClientOnUnstructured ¶ added in v0.8.20
func GetDynamicClientOnUnstructured(context context.Context, obj *unstructured.Unstructured) (dynamic.ResourceInterface, error)
GetDynamicClientOnUnstructured returns a dynamic client on an Unstructured type. This client can be further namespaced. needs context with log and restConfig TODO consider refactoring using apimachinery.RESTClientForGVK in controller-runtime
func IsDriftDetectionEnabled ¶ added in v0.8.34
func IsDriftDetectionEnabled() bool
IsDriftDetectionEnabled returns whether drift detection is enabled Controlled via ENABLE_DRIFT_DETECTION environment variable (default: false)
func ManageOutcome ¶ added in v0.8.9
func ManageOutcomeWithRequeue ¶ added in v0.8.9
func NewLookupFunction ¶ added in v0.8.20
NewLookupFunction get information at runtime from cluster
func SetIndexField ¶ added in v0.8.20
func SetIndexField(context context.Context, cache cache.Cache, obj client.Object, path string) error
SetIndexField this function allows to prepare an index field for an objct so that fieldSelector can be used. It needs a cache object probably obtained via mrg.GetCache() This is a generic implementation, so it's relatively slow path should be expressed in the form of .<field>.<field> ... needs context with log
func SetSyncPeriod ¶ added in v0.8.34
SetSyncPeriod sets the sync period for use in predicates
Types ¶
type PeriodicReconcilePredicate ¶ added in v0.8.34
type PeriodicReconcilePredicate struct { predicate.Funcs // ReconcileInterval defines how often to allow reconciliation even without spec changes ReconcileInterval time.Duration }
PeriodicReconcilePredicate combines generation-based filtering with optional time-based reconciliation to allow periodic drift detection while avoiding excessive API calls. This predicate replaces ResourceGenerationChangedPredicate and provides both: 1. Immediate reconciliation on spec changes (generation change) 2. Optional periodic reconciliation for drift detection when enabled via ENABLE_DRIFT_DETECTION
func NewDefaultPeriodicReconcilePredicate ¶ added in v0.8.34
func NewDefaultPeriodicReconcilePredicate() PeriodicReconcilePredicate
NewDefaultPeriodicReconcilePredicate creates a new predicate using the configured sync period
func NewPeriodicReconcilePredicate ¶ added in v0.8.34
func NewPeriodicReconcilePredicate(reconcileInterval time.Duration) PeriodicReconcilePredicate
NewPeriodicReconcilePredicate creates a new predicate with the specified reconcile interval
func NewPeriodicReconcilePredicateWithSyncPeriod ¶ added in v0.8.34
func NewPeriodicReconcilePredicateWithSyncPeriod(syncPeriod time.Duration) PeriodicReconcilePredicate
NewPeriodicReconcilePredicateWithSyncPeriod creates a new predicate using the manager's sync period as the reconcile interval
func (PeriodicReconcilePredicate) Update ¶ added in v0.8.34
func (p PeriodicReconcilePredicate) Update(e event.UpdateEvent) bool
Update implements UpdateEvent filter that provides unified reconciliation logic: - Always reconciles on spec changes (generation change) for immediate response - Optionally reconciles periodically after time interval for drift detection when enabled
type ReconcilerBase ¶ added in v0.8.20
type ReconcilerBase struct { Log logr.Logger ControllerName string // contains filtered or unexported fields }
func NewFromManager ¶ added in v0.8.20
func NewFromManager(mgr manager.Manager, controllerName string) ReconcilerBase
NewReconcilerBase is a contruction function to create a new ReconcilerBase.
func NewReconcilerBase ¶ added in v0.8.20
func (*ReconcilerBase) CreateOrUpdateResource ¶ added in v0.8.20
func (r *ReconcilerBase) CreateOrUpdateResource(context context.Context, owner client.Object, namespace string, obj client.Object) error
CreateOrUpdateResource creates a resource if it doesn't exist, and updates (overwrites it), if it exist if owner is not nil, the owner field os set if namespace is not "", the namespace field of the object is overwritten with the passed value
func (*ReconcilerBase) DeleteResourceIfExists ¶ added in v0.8.20
DeleteResourceIfExists deletes an existing resource. It doesn't fail if the resource does not exist
func (*ReconcilerBase) GetClient ¶ added in v0.8.20
func (r *ReconcilerBase) GetClient() client.Client
GetClient returns the underlying client
func (*ReconcilerBase) GetDiscoveryClient ¶ added in v0.8.20
func (r *ReconcilerBase) GetDiscoveryClient() (*discovery.DiscoveryClient, error)
GetDiscoveryClient returns a discovery client for the current reconciler
func (*ReconcilerBase) GetRecorder ¶ added in v0.8.20
func (r *ReconcilerBase) GetRecorder() record.EventRecorder
GetRecorder returns the underlying recorder
func (*ReconcilerBase) GetRestConfig ¶ added in v0.8.20
func (r *ReconcilerBase) GetRestConfig() *rest.Config
GetRestConfig returns the undelying rest config
func (*ReconcilerBase) GetScheme ¶ added in v0.8.20
func (r *ReconcilerBase) GetScheme() *runtime.Scheme
GetScheme returns the scheme
type VaultEngineResource ¶
type VaultEngineResource struct {
// contains filtered or unexported fields
}
func NewVaultEngineResource ¶
func NewVaultEngineResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultEngineResource
type VaultPKIEngineResource ¶ added in v0.3.0
type VaultPKIEngineResource struct {
// contains filtered or unexported fields
}
func NewVaultPKIEngineResource ¶ added in v0.3.0
func NewVaultPKIEngineResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultPKIEngineResource
type VaultResource ¶
type VaultResource struct {
// contains filtered or unexported fields
}
func NewVaultResource ¶
func NewVaultResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultResource