Documentation
¶
Index ¶
- func GetPodCliqueNameFromPodCliqueFQN(pclqObjectMeta metav1.ObjectMeta) (string, error)
- func GetPodCliqueSetReplicaIndexFromPodCliqueFQN(pcsName, pclqFQNName string) (int, error)
- func IsEmptyStringType[T ~string](val T) bool
- func OnlyOneIsNil[T any](objA, objB *T) bool
- type RunResult
- func RunConcurrently(ctx context.Context, logger logr.Logger, tasks []Task) RunResult
- func RunConcurrentlyWithBounds(ctx context.Context, logger logr.Logger, tasks []Task, bound int) RunResult
- func RunConcurrentlyWithSlowStart(ctx context.Context, logger logr.Logger, initialBatchSize int, tasks []Task) RunResult
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPodCliqueNameFromPodCliqueFQN ¶
func GetPodCliqueNameFromPodCliqueFQN(pclqObjectMeta metav1.ObjectMeta) (string, error)
GetPodCliqueNameFromPodCliqueFQN extracts the unqualified PodClique name from a fully qualified name.
func GetPodCliqueSetReplicaIndexFromPodCliqueFQN ¶
GetPodCliqueSetReplicaIndexFromPodCliqueFQN extracts the PodCliqueSet replica index from a Pod Clique FQN name.
func IsEmptyStringType ¶
IsEmptyStringType returns true if value (which is a string or has an underline type string) is empty or contains only whitespace characters.
func OnlyOneIsNil ¶
OnlyOneIsNil returns true if only one of the Objects is nil else it will return false.
Types ¶
type RunResult ¶
type RunResult struct {
// SuccessfulTasks are the names of tasks that executed successfully.
SuccessfulTasks []string
// FailedTasks are the names of tasks that failed during execution.
FailedTasks []string
// SkippedTasks are the names of tasks that were skipped.
SkippedTasks []string
// Errors contains all errors encountered during task execution.
Errors []error
}
RunResult holds the results of running tasks concurrently.
func RunConcurrently ¶
RunConcurrently executes a slice of Tasks concurrently.
func RunConcurrentlyWithBounds ¶
func RunConcurrentlyWithBounds(ctx context.Context, logger logr.Logger, tasks []Task, bound int) RunResult
RunConcurrentlyWithBounds executes a slice of Tasks with at most `bound` taskConfigs running concurrently.
func RunConcurrentlyWithSlowStart ¶
func RunConcurrentlyWithSlowStart(ctx context.Context, logger logr.Logger, initialBatchSize int, tasks []Task) RunResult
RunConcurrentlyWithSlowStart executes tasks in exponentially growing batches starting at initialBatchSize. Each successful batch doubles the size of the next batch. On any batch failure, execution halts immediately and remaining tasks are marked as skipped. This prevents overwhelming kube-apiserver with concurrent requests.
func (*RunResult) GetAggregatedError ¶
GetAggregatedError returns all task errors joined into a single error.
func (*RunResult) GetSummary ¶
GetSummary returns a summary of successful, failed, and skipped tasks.