summaryrule

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

func PatchClaim(ctx context.Context, c client.Client, sr *v1.SummaryRule, owner string) error

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

func SafeToAdopt(sr *v1.SummaryRule, clk clock.Clock) (bool, string)

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.

Jump to

Keyboard shortcuts

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