Documentation ¶
Index ¶
- Variables
- func AddFinalizer(object metav1.Object, finalizer string) (changed bool)
- func CRDIsEstablished(crd *apiextensionsv1.CustomResourceDefinition) bool
- func CmdLogMixin(cmd *cobra.Command) *cobra.Command
- func DeleteObjects(ctx context.Context, cl client.Client, scheme *runtime.Scheme, ...) (cleanedUp bool, err error)
- func DeploymentIsAvailable(deployment *appsv1.Deployment) bool
- func ListObjects(ctx context.Context, cl client.Client, scheme *runtime.Scheme, ...) ([]runtime.Object, error)
- func MustLogLine(obj runtime.Object, scheme *runtime.Scheme) string
- func RemoveFinalizer(object metav1.Object, finalizer string) (changed bool)
- func UpdateObservedGeneration(src, dest *unstructured.Unstructured) error
- type ClientWatcher
- type ClientWatcherOption
- type ObjectReference
- type PredicateFn
Constants ¶
This section is empty.
Variables ¶
var ZapLogger *zap.Logger
Functions ¶
func AddFinalizer ¶
AddFinalizer adds the Finalizer to the metav1.Object if the Finalizer is not present.
func CRDIsEstablished ¶ added in v0.2.0
func CRDIsEstablished(crd *apiextensionsv1.CustomResourceDefinition) bool
func CmdLogMixin ¶
CmdLogMixin adds necessary CLI flags for logging and setups the controller runtime log
func DeleteObjects ¶
func DeleteObjects(ctx context.Context, cl client.Client, scheme *runtime.Scheme, listTypes []runtime.Object, options ...client.ListOption) (cleanedUp bool, err error)
Delete deletes all object of given types adhering to additional ListOptions
func DeploymentIsAvailable ¶
func DeploymentIsAvailable(deployment *appsv1.Deployment) bool
DeploymentIsAvailable checks if a deployment is available.
func ListObjects ¶
func ListObjects(ctx context.Context, cl client.Client, scheme *runtime.Scheme, listTypes []runtime.Object, options ...client.ListOption) ([]runtime.Object, error)
ListObjects lists all object of given types adhering to additional ListOptions
func MustLogLine ¶ added in v0.2.0
func RemoveFinalizer ¶
RemoveFinalizer removes the finalizer from the metav1.Object if the Finalizer is present.
func UpdateObservedGeneration ¶
func UpdateObservedGeneration(src, dest *unstructured.Unstructured) error
UpdateObservedGeneration sets dest.Status.ObservedGeneration=dest.Generation, if src.Generation == src.Status.ObservedGeneration
Types ¶
type ClientWatcher ¶
func NewClientWatcher ¶
func (*ClientWatcher) WaitUntil ¶
func (cw *ClientWatcher) WaitUntil(ctx context.Context, obj runtime.Object, cond func() (done bool, err error), options ...ClientWatcherOption) error
WaitUntil waits until the Object's condition function is true, or the context deadline is reached
condition function should operate on the passed object in a closure and should not modify the obj
func (*ClientWatcher) WaitUntilNotFound ¶ added in v0.2.0
func (cw *ClientWatcher) WaitUntilNotFound(ctx context.Context, obj runtime.Object, options ...ClientWatcherOption) error
WaitUntilNotFound waits until the object is not found or the context deadline is exceeded
type ClientWatcherOption ¶ added in v0.2.0
type ClientWatcherOption func(*clientWatcherOption) error
func WithClientWatcherTimeout ¶ added in v0.2.0
func WithClientWatcherTimeout(t time.Duration) ClientWatcherOption
func WithoutClientWatcher ¶ added in v0.2.0
func WithoutClientWatcher() ClientWatcherOption
type ObjectReference ¶
type ObjectReference struct { // Name of the referent. Name string `json:"name"` // Namespace that the referent object lives in. Namespace string `json:"namespace"` // The API Group of the referent. Group string `json:"group"` // The Kind of the referent. Kind string `json:"kind"` }
ObjectReference references an owning/controlling object across Namespaces.
func ToObjectReference ¶
func ToObjectReference(object runtime.Object, scheme *runtime.Scheme) ObjectReference
ToOwnerReference converts the given object into an ownerReference.
type PredicateFn ¶
func (PredicateFn) Create ¶
func (p PredicateFn) Create(ev event.CreateEvent) bool
func (PredicateFn) Delete ¶
func (p PredicateFn) Delete(ev event.DeleteEvent) bool
func (PredicateFn) Generic ¶
func (p PredicateFn) Generic(ev event.GenericEvent) bool
func (PredicateFn) Update ¶
func (p PredicateFn) Update(ev event.UpdateEvent) bool