Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller implements the SyncReconciler contoller interface, deleting namespaces in StorageOS when they have been detected as deleted in Kubernetes.
func NewController ¶
func NewController(api NamespaceDeleter, log logr.Logger) (*Controller, error)
NewController returns a Controller that implements namespace garbage collection in StorageOS.
func (Controller) Delete ¶
Delete receives a k8s object that's been deleted and calls the StorageOS api to remove it from management.
func (Controller) List ¶
func (c Controller) List(ctx context.Context) ([]types.NamespacedName, error)
List returns a list of namespaces known to StorageOS, as NamespacedNames. This is used for garbage collection and can be expensive. The garbage collector is run in a separate goroutine periodically, not affecting the main reconciliation control-loop.
type NamespaceDeleter ¶
type NamespaceDeleter interface { DeleteNamespace(ctx context.Context, key client.ObjectKey) error ListNamespaces(ctx context.Context) ([]storageos.Object, error) }
NamespaceDeleter provides access to removing namespaces from StorageOS.
type Predicate ¶
type Predicate struct {
predicate.IgnoreFuncs
}
Predicate filters events before enqueuing the keys. Ignore all but Delete events.
type Reconciler ¶
type Reconciler struct { client.Client objectv1.Reconciler // contains filtered or unexported fields }
Reconciler reconciles a Namespace object by deleting the StorageOS namespace when the corresponding Kubernetes namespace is deleted.
func NewReconciler ¶
func NewReconciler(api NamespaceDeleter, k8s client.Client, gcDelay time.Duration, gcInterval time.Duration) *Reconciler
NewReconciler returns a new Namespace delete reconciler.
The gcInterval determines how often the periodic resync operation should be run.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, workers int) error
SetupWithManager registers the controller with the controller manager.