informer

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateFormat = "2006-01-02T15:04:05"

	ReconcileStartedAnnotation   = reconcileAnnotationPrefix + "reconcileStartedAt"
	ReconcileCompletedAnnotation = reconcileAnnotationPrefix + "reconcileCompletedAt"
)

Variables

This section is empty.

Functions

func CheckFluxCRDs

func CheckFluxCRDs(ctx context.Context, kubeClient client.Client, retryTimeout time.Duration) error

func GetChildHelmReleases

func GetChildHelmReleases(obj FluxObject) (hrList []string)

Special function to retrieve HelmReleases produced by a Kustomization

func NewScheme

func NewScheme() *runtime.Scheme

Types

type FluxAdapter

type FluxAdapter interface {
	DeepCopy() FluxAdapter
	ClientObject() client.Object
	Suspended() bool
	GetLastHandledReconcileAt() string
	IsStatic() bool
	GetObservedGeneration() int64
	ListDependencies() []string
	// contains filtered or unexported methods
}

type FluxObject

type FluxObject interface {
	FluxAdapter
	QualifiedName() string
	DisplayName() string

	GetAnnotationValue(annotationName string) string
	HasHandledReconcileAnnotation() bool
	HasMissingDependencies() bool
	GetMissingDependencies() []string
	SetMissingDependencies([]string)
	Status() string
	Ready() bool
	Stalled() bool
	// contains filtered or unexported methods
}

func NewFluxObject

func NewFluxObject(obj FluxAdapter, defaultNs string) FluxObject

type Node

type Node interface {
	FluxObject
	GetObject() FluxObject

	Reconciled() bool

	Watched() bool
	// contains filtered or unexported methods
}

func NewNode

func NewNode(object FluxObject, watched bool) Node

Node

type NodeList

type NodeList []Node

func (NodeList) Len

func (m NodeList) Len() int

Sort interface for NodeList

func (NodeList) Less

func (m NodeList) Less(i, j int) bool

func (NodeList) Swap

func (m NodeList) Swap(i, j int)

type NodeVisitor

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

func (*NodeVisitor) Visit

func (nv *NodeVisitor) Visit(v dag.Vertexer)

For any edge a -> b (eg. b depends on a), node a will be visited before node b.

type ObjEvent

type ObjEvent struct {
	FluxObject
	Delete bool
}

type ObjectMap

type ObjectMap interface {
	Store(object FluxObject, updateDeps bool) (FluxObject, Node, bool, error)
	Remove(object FluxObject) error
	Items() NodeList
	Get(qualifiedName string) (Node, bool)
	SortedWatchedResources() NodeList

	ProcessTopologyChange() error

	DependsOn(dependent string, dependency string) bool
	GetDependencies(nodeName string) NodeList
	GetDependents(nodeName string) NodeList
	// contains filtered or unexported methods
}

func MapFrom

func MapFrom(dag *dag.DAG, watchedNode string) ObjectMap

func NewMap

func NewMap(watchedNode string) ObjectMap

objectMap

type TreeInformer

type TreeInformer struct {
	context.Context
	context.CancelFunc
	sync.WaitGroup
	client.Client
	Initialized         bool
	ReconcileDependents bool
	ResumeSuspended     bool

	ObjectMap
	ObjEvents chan ObjEvent
	// contains filtered or unexported fields
}

func NewInformer

func NewInformer(ctx context.Context, config *rest.Config, objEvents chan ObjEvent, watchedResource string,
	reconcileDependents bool, resumeSuspended bool, retryTimeout time.Duration, namespace string, recordFile string) (*TreeInformer, error)

func (*TreeInformer) CurrentReconcileDuration

func (t *TreeInformer) CurrentReconcileDuration(refObj FluxObject, curObj FluxObject) time.Duration

Returns the duration of current reconcile request, based on reconcile annotations It computes the time elapsed since ReconcileStartedAnnotation of reference object, if it was set with current reconcileID, otherwise it returns 0 If corresponding ReconcileCompletedAnnotation has been set on current object, return the reconcile duration.

func (*TreeInformer) NotifyReconcilableDependents

func (t *TreeInformer) NotifyReconcilableDependents(object FluxObject)

func (*TreeInformer) Reconcilable

func (t *TreeInformer) Reconcilable(node Node) bool

func (*TreeInformer) Stop

func (t *TreeInformer) Stop()

func (*TreeInformer) UpdateObject

func (t *TreeInformer) UpdateObject(fluxObject FluxObject, annotations map[string]string, resume bool)

Jump to

Keyboard shortcuts

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