Documentation
¶
Index ¶
- func BundleStatusChangedPredicate() predicate.TypedFuncs[*fleet.Bundle]
- func MergeConditions(live, base, desired []genericcondition.GenericCondition, foreign ...string) []genericcondition.GenericCondition
- func PatchStatus(ctx context.Context, c client.Client, orig, obj client.Object) error
- func SetFields(list *fleet.BundleDeploymentList, status *fleet.StatusBase) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundleStatusChangedPredicate ¶
func BundleStatusChangedPredicate() predicate.TypedFuncs[*fleet.Bundle]
BundleStatusChangedPredicate returns true if the bundle status has changed, or the bundle was created
func MergeConditions ¶
func MergeConditions( live, base, desired []genericcondition.GenericCondition, foreign ...string, ) []genericcondition.GenericCondition
MergeConditions merges the condition list a controller wants to publish into the list currently live on the object.
A merge patch replaces the whole conditions array, so a controller which rebuilds that array from a snapshot taken at the start of its reconcile silently reverts, or outright deletes, conditions another controller wrote while it was working. Fleet has several writers per object (the GitRepo and HelmOp reconcilers, their polling jobs and their status reconcilers), so that window is real: a polling job clearing Stalled can be undone seconds later by a reconciler that started before the clear.
Comparing desired against base, the list as the caller first read it, tells the two cases apart. A condition type whose value the caller actually changed is one it computed, and wins. Every other type is only a stale echo of the read, and keeps whatever is live. Types named in foreign are owned by another controller entirely and are always taken from live.
Conditions are never removed, only added or updated, so live ordering is preserved and types the caller newly computed are appended.
func PatchStatus ¶
PatchStatus patches the status of obj against orig under an optimistic lock, skipping the request if nothing changed.
func SetFields ¶
func SetFields(list *fleet.BundleDeploymentList, status *fleet.StatusBase) error
setFields sets bundledeployment related status fields: Summary, ReadyClusters, DesiredReadyClusters, Display.State, Display.Message, Display.Error
Types ¶
This section is empty.