event

package
v0.36.0-flux.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceStatusEqual

func ResourceStatusEqual(or1, or2 *ResourceStatus) bool

ResourceStatusEqual checks if two instances of ResourceStatus are the same. This is used to determine whether status has changed for a particular resource. Important to note that this does not check all fields, but only the ones that are considered part of the status for a resource. So if the status or the message of an ResourceStatus (or any of its generated ResourceStatuses) have changed, this will return true. Changes to the state of the resource itself that doesn't impact status are not considered.

Types

type Event

type Event struct {
	// Type defines the type of event.
	Type Type

	// Resource is only available for ResourceUpdateEvents. It includes information about the resource,
	// including the resource status, any errors and the resource itself (as an unstructured).
	Resource *ResourceStatus

	// Error is only available for ErrorEvents. It contains the error that caused the engine to
	// give up.
	Error error
}

Event defines that type that is passed back through the event channel to notify the caller of changes as resources are being polled.

func (Event) String

func (e Event) String() string

String returns a string suitable for logging

type ResourceStatus

type ResourceStatus struct {
	// Identifier contains the information necessary to locate the
	// resource within a cluster.
	Identifier object.ObjMetadata

	// Status is the computed status for this resource.
	Status status.Status

	// Resource contains the actual manifest for the resource that
	// was fetched from the cluster and used to compute status.
	Resource *unstructured.Unstructured

	// Errors contains the error if something went wrong during the
	// process of fetching the resource and computing the status.
	Error error

	// Message is text describing the status of the resource.
	Message string

	// GeneratedResources is a slice of ResourceStatus that
	// contains information and status for any generated resources
	// of the current resource.
	GeneratedResources ResourceStatuses
}

ResourceStatus contains information about a resource after we have fetched it from the cluster and computed status.

func (ResourceStatus) String

func (rs ResourceStatus) String() string

String returns a string suitable for logging

type ResourceStatuses

type ResourceStatuses []*ResourceStatus

func (ResourceStatuses) Len

func (g ResourceStatuses) Len() int

func (ResourceStatuses) Less

func (g ResourceStatuses) Less(i, j int) bool

func (ResourceStatuses) Swap

func (g ResourceStatuses) Swap(i, j int)

type Type

type Type int

Type is the type that describes the type of an Event that is passed back to the caller as resources in the cluster are being polled.

const (
	// ResourceUpdateEvent describes events related to a change in the status of one of the polled resources.
	ResourceUpdateEvent Type = iota // Update
	// ErrorEvent signals that the engine has encountered an error that it can not recover from. The engine
	// is shutting down and the event channel will be closed after this event.
	ErrorEvent // Error
	// SyncEvent signals that the engine has completed its initial
	// synchronization, and the cache is primed. After this point, it's safe to
	// assume that you won't miss events caused by your own subsequent actions.
	SyncEvent // Sync
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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