Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildByBuildConfigIndexFunc ¶
BuildByBuildConfigIndexFunc indexes Build items by their associated BuildConfig, if none, index with key "orphan"
Types ¶
type DataSet ¶
type DataSet interface { GetBuildConfig(build *buildapi.Build) (*buildapi.BuildConfig, bool, error) ListBuildConfigs() ([]*buildapi.BuildConfig, error) ListBuilds() ([]*buildapi.Build, error) ListBuildsByBuildConfig(buildConfig *buildapi.BuildConfig) ([]*buildapi.Build, error) }
DataSet provides functions for working with build data
func NewDataSet ¶
func NewDataSet(buildConfigs []*buildapi.BuildConfig, builds []*buildapi.Build) DataSet
NewDataSet returns a DataSet over the specified items
type FilterPredicate ¶
FilterPredicate is a function that returns true if the object should be included in the filtered set
func NewFilterBeforePredicate ¶
func NewFilterBeforePredicate(d time.Duration) FilterPredicate
NewFilterBeforePredicate is a function that returns true if the build was created before the current time minus specified duration
type PruneTasker ¶
type PruneTasker interface { // PruneTask is an object that knows how to execute a single iteration of a Prune PruneTask() error }
func NewPruneTasker ¶
func NewPruneTasker(buildConfigs []*buildapi.BuildConfig, builds []*buildapi.Build, keepYoungerThan time.Duration, orphans bool, keepComplete int, keepFailed int, handler PruneFunc) PruneTasker
NewPruneTasker returns a PruneTasker over specified data using specified flags keepYoungerThan will filter out all objects from prune data set that are younger than the specified time duration orphans if true will include inactive orphan builds in candidate prune set keepComplete is per BuildConfig how many of the most recent builds should be preserved keepFailed is per BuildConfig how many of the most recent failed builds should be preserved
type Resolver ¶
Resolver knows how to resolve the set of candidate objects to prune
func NewOrphanBuildResolver ¶
func NewOrphanBuildResolver(dataSet DataSet, buildStatusFilter []buildapi.BuildStatus) Resolver
NewOrphanBuildResolver returns a Resolver that matches Build objects with no associated BuildConfig and has a BuildStatus in filter