Documentation
¶
Index ¶
- func ClaimInMemory(sr *v1.SummaryRule, owner string)
- func IsOwnedBy(sr *v1.SummaryRule, owner string) bool
- func PatchClaim(ctx context.Context, c client.Client, sr *v1.SummaryRule, owner string) error
- func SafeToAdopt(sr *v1.SummaryRule, clk clock.Clock) (bool, string)
- func SetStatusOwnerCondition(sr *v1.SummaryRule, status metav1.ConditionStatus, reason, msg string)
- func WantsOwner(sr *v1.SummaryRule, owner string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaimInMemory ¶
func ClaimInMemory(sr *v1.SummaryRule, owner string)
ClaimInMemory sets owner annotation and clears desired-owner on the object instance. This only mutates the in-memory object; caller must patch/update to persist.
func IsOwnedBy ¶
func IsOwnedBy(sr *v1.SummaryRule, owner string) bool
IsOwnedBy returns true if the SummaryRule is owned by the given owner value. Semantics: - Missing/empty annotation defaults to ingestor ownership for backward compatibility. - Unknown values return false (fail-closed; neither component processes).
func PatchClaim ¶
PatchClaim patches the object on the API server to claim ownership and clear desired-owner. It uses a MergeFrom patch to avoid clobbering other fields.
func SafeToAdopt ¶
SafeToAdopt returns true when it's safe to adopt ownership: - no inflight async operations, and - not currently due to submit work according to ShouldSubmitRule. It returns an optional reason for logging/debugging.
func SetStatusOwnerCondition ¶
func SetStatusOwnerCondition(sr *v1.SummaryRule, status metav1.ConditionStatus, reason, msg string)
SetStatusOwnerCondition is a small helper to set a status condition for owner info, if desired. Kept here to avoid duplicating reason typing across components. Optional to use.
func WantsOwner ¶
func WantsOwner(sr *v1.SummaryRule, owner string) bool
WantsOwner returns true if the desired-owner annotation matches the owner value.
Types ¶
This section is empty.