resourcewatcher

package
v1.118.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForResourceToBeReadyViaWatch added in v1.92.0

func WaitForResourceToBeReadyViaWatch(ctx context.Context, watch watch.Interface, logger logr.Logger) error

WaitForResourceToBeReadyViaWatch monitors a given 'Watch' for any updates to the resource that the given 'Watch' is targeting. Note that an error is returned to signify a failure during the 'Watch' process, while nil is returned to signify the watched resource is ready.

Types

type ResourceWatcher

type ResourceWatcher struct {
	// contains filtered or unexported fields
}

func New

func New(clientConfig *rest.Config, logger logr.Logger) (*ResourceWatcher, error)

New creates a new ResourceWatcher that uses a dynamic client to monitor the status of requested resources

func NewWithClient

func NewWithClient(dynamicClient dynamic.Interface, logger logr.Logger) *ResourceWatcher

func (*ResourceWatcher) WaitForResourceToBeReady

func (r *ResourceWatcher) WaitForResourceToBeReady(ctx context.Context, nn types.NamespacedName, gvk schema.GroupVersionKind) error

WaitForResourceToBeReady waits for the resource identified by the given GVK and NamespacedName. It blocks until the resource is ready, an error occurs, or a context cancellation occurs. Note that a nil return value signifies that the resource is ready and no errors have occurred.

func (*ResourceWatcher) WatchResource added in v1.92.0

WatchResource creates a watch on a resource identified by the given GVK and NamespacedName.

Jump to

Keyboard shortcuts

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