Documentation ¶
Index ¶
- Constants
- func GetValidateMode(mode api.SynchronizationMode, log logr.Logger) api.SynchronizationMode
- type HNCConfigReconcilerType
- type Reconciler
- func (r *Reconciler) GetGVK() schema.GroupVersionKind
- func (r *Reconciler) GetMode() api.SynchronizationMode
- func (r *Reconciler) GetNumPropagatedObjects() int
- func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *Reconciler) SetMode(ctx context.Context, log logr.Logger, mode api.SynchronizationMode) error
- func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, maxReconciles int) error
- func (r *Reconciler) SyncNamespace(ctx context.Context, log logr.Logger, ns string) error
- type Validator
Constants ¶
const ( // ServingPath is where the validator will run. Must be kept in sync // with the kubebuilder markers below. ServingPath = "/validate-objects" )
Variables ¶
This section is empty.
Functions ¶
func GetValidateMode ¶
func GetValidateMode(mode api.SynchronizationMode, log logr.Logger) api.SynchronizationMode
GetValidateMode returns a valid api.SynchronizationMode based on the given mode. Please see the comments of api.SynchronizationMode for currently supported modes. If mode is not set, it will be api.Propagate by default. Any unrecognized mode is treated as api.Ignore.
Types ¶
type HNCConfigReconcilerType ¶
type HNCConfigReconcilerType interface {
Enqueue(reason string)
}
type Reconciler ¶
type Reconciler struct { client.Client EventRecorder record.EventRecorder Log logr.Logger // Forest is the in-memory forest managed by the HierarchyConfigReconciler. Forest *forest.Forest // GVK is the group/version/kind handled by this reconciler. GVK schema.GroupVersionKind // Mode describes propagation mode of objects that are handled by this reconciler. // See more details in the comments of api.SynchronizationMode. Mode api.SynchronizationMode // Affected is a channel of event.GenericEvent (see "Watching Channels" in // https://book-v1.book.kubebuilder.io/beyond_basics/controller_watches.html) that is used to // enqueue additional objects that need updating. Affected chan event.GenericEvent // AffectedNamespace is a channel of events used to update namespaces. AffectedNamespace chan event.GenericEvent HNCConfigReconciler HNCConfigReconcilerType // contains filtered or unexported fields }
Reconciler reconciles generic propagated objects. You must create one for each group/version/kind that needs to be propagated and set its `GVK` field appropriately.
func (*Reconciler) GetGVK ¶
func (r *Reconciler) GetGVK() schema.GroupVersionKind
GetGVK provides GVK that is handled by this reconciler.
func (*Reconciler) GetMode ¶
func (r *Reconciler) GetMode() api.SynchronizationMode
GetMode provides the mode of objects that are handled by this reconciler.
func (*Reconciler) GetNumPropagatedObjects ¶
func (r *Reconciler) GetNumPropagatedObjects() int
GetNumPropagatedObjects returns the number of propagated objects of the GVK handled by this object reconciler.
func (*Reconciler) SetMode ¶
func (r *Reconciler) SetMode(ctx context.Context, log logr.Logger, mode api.SynchronizationMode) error
SetMode sets the Mode field of an object reconciler and syncs objects in the cluster if needed. The method will return an error if syncs fail.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, maxReconciles int) error
func (*Reconciler) SyncNamespace ¶
SyncNamespace can be called manually by the HierarchyConfigReconciler when the hierarchy changes. It enqueues all the current objects in the namespace and local copies of the original objects in the ancestors.