apimachinery

package
v0.0.0-...-300c491 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 19 Imported by: 0

Documentation

Index

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 CreateIfNotFound(ctx context.Context, c client.Client, logger logr.Logger, waitFn waitFn, readyFn readFn, obj runtime.Object) error

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 CreateOrUpdateEphemeralContainer

func CreateOrUpdateEphemeralContainer(config *rest.Config, namespace, podName, ephemeralContainerName, image string) error

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 EphemeralContainerInStatus

func EphemeralContainerInStatus(ctx context.Context, config *rest.Config, namespace string, name string) error

func HasFinalizer

func HasFinalizer(obj runtime.Object, finalizerName string) (bool, error)

HasFinalizer checks if the given object has a finalizer with the given name.

func ReconcileErr

func ReconcileErr(err error) (reconcile.Result, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL