monitor

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNamespaceFn

func AssertNamespaceFn(
	ctx context.Context,
	logger *slog.Logger,
	kube k8s.Interface,
	namespace string,
) (monitorQueueFn, error)

AssertNamespaceFn returns a function that asserts if the informed namespace exists, otherwise returns error.

Types

type Interface

type Interface interface {
	// Collect collects relevant resources for later inspection.
	Collect(context.Context, *resource.Info) error

	// Watch waits for all monitoring functions to complete, or until the timeout
	// is reached.
	Watch(time.Duration) error
}

Interface is the interface that defines the methods of a Monitor.

type Monitor

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

Monitor is the monitoring actor which collects interesting resources from a Helm Chart release payload, and monitors them until they are ready. The monitoring is executed with a queue of functions, which are executed in order until the queue is empty or timeout is reached.

func NewMonitor

func NewMonitor(logger *slog.Logger, kube k8s.Interface) *Monitor

NewMonitor instantiates a new Monitor.

func (*Monitor) Collect

func (m *Monitor) Collect(ctx context.Context, r *resource.Info) error

Collect inspects the resource and adds a monitoring function to the queue.

func (*Monitor) Watch

func (m *Monitor) Watch(timeout time.Duration) error

Watch waits for all monitoring functions to complete, or until the timeout is reached. Returns error if the queue is not empty after timeout.

Jump to

Keyboard shortcuts

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