progress

package
v0.113.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartedPercent   = "0"
	CompletedPercent = "100"
)

Variables

This section is empty.

Functions

func SetActionSetPercentCompleted

func SetActionSetPercentCompleted(actionSet *crv1alpha1.ActionSet) error

SetActionSetPercentCompleted calculate and set percent completion of the action. The action completion percentage is calculated by taking an average of all the involved phases.

func UpdateActionSetsProgress

func UpdateActionSetsProgress(
	ctx context.Context,
	aIDX int,
	client versioned.Interface,
	actionSetName string,
	namespace string,
	p *kanister.Phase,
) error

UpdateActionSetsProgress tries to assess the progress of an actionSet by watching the states of all the phases in its actions. It starts an infinite loop, using a ticker to determine when to assess the phases. The function returns when the provided context is either done or cancelled. Caller should invoke this function in a non-main goroutine, to avoid introducing any latencies on Kanister critical path. If an error happens while attempting to update the actionSet, the failed iteration will be skipped with no further retries, until the next tick.

Types

This section is empty.

Jump to

Keyboard shortcuts

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