Documentation ¶
Index ¶
- func Can(ctx context.Context, client client.Client, ...) error
- func CreateIfNotFound(ctx context.Context, c client.Client, logger logr.Logger, waitFn waitFn, ...) error
- func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, ...) error
- func CreateOrUpdateEphemeralContainer(config *rest.Config, namespace, podName, ephemeralContainerName, image string) error
- func DeleteFinalizer(ctx context.Context, client client.Client, finalizerName string, ...) error
- func EnsureFinalizer(ctx context.Context, client client.Client, finalizerName string, ...) error
- func EphemeralContainerInStatus(ctx context.Context, config *rest.Config, namespace string, name string) error
- func HasFinalizer(obj runtime.Object, finalizerName string) (bool, error)
- func ReconcileErr(err error) (reconcile.Result, error)
- func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Can ¶
func Can(ctx context.Context, client client.Client, resourceAttr *authorizationv1.ResourceAttributes) error
Can checks if current user has permissions
func CreateIfNotFound ¶
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, transform func() error) error
CreateOrUpdate creates or updates the object. Optionally, it executes a transformation function before the request is made.
func DeleteFinalizer ¶
func DeleteFinalizer(ctx context.Context, client client.Client, finalizerName string, obj runtime.Object) error
DeleteFinalizer ensures that the given finalizer is not present anymore in the given object. If it is set, it removes it and issues an update.
func EnsureFinalizer ¶
func EnsureFinalizer(ctx context.Context, client client.Client, finalizerName string, obj runtime.Object) error
EnsureFinalizer ensures that a finalizer of the given name is set on the given object. If the finalizer is not set, it adds it to the list of finalizers and updates the remote object.
func HasFinalizer ¶
HasFinalizer checks if the given object has a finalizer with the given name.
func ReconcileErr ¶
ReconcileErr returns a reconcile.Result or an error, depending on whether the error is a RequeueAfterError or not.
func TryUpdateStatus ¶
func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj runtime.Object, transform func() error) error
TryUpdateStatus tries to apply the given transformation function onto the given object, and to update its status afterwards. It retries the status update with an exponential backoff.
Types ¶
This section is empty.