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 BuildDeleter ¶ added in v1.3.0
type BuildDeleter interface { // DeleteBuild removes the build from OpenShift's storage. DeleteBuild(build *buildapi.Build) error }
BuildDeleter knows how to delete builds from OpenShift.
func NewBuildDeleter ¶ added in v1.3.0
func NewBuildDeleter(builds client.BuildsNamespacer) BuildDeleter
NewBuildDeleter creates a new buildDeleter.
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 Pruner ¶ added in v1.3.0
type Pruner interface { // Prune is responsible for actual removal of builds identified as candidates // for pruning based on pruning algorithm. Prune(deleter BuildDeleter) error }
func NewPruner ¶ added in v1.3.0
func NewPruner(options PrunerOptions) Pruner
NewPruner returns a Pruner over specified data using specified options.
type PrunerOptions ¶ added in v1.3.0
type PrunerOptions struct { // KeepYoungerThan indicates the minimum age a BuildConfig must be to be a // candidate for pruning. KeepYoungerThan time.Duration // Orphans if true will include inactive orphan builds in candidate prune set Orphans bool // KeepComplete is per BuildConfig how many of the most recent builds should be preserved KeepComplete int // KeepFailed is per BuildConfig how many of the most recent failed builds should be preserved KeepFailed int // BuildConfigs is the entire list of buildconfigs across all namespaces in the cluster. BuildConfigs []*buildapi.BuildConfig // Builds is the entire list of builds across all namespaces in the cluster. Builds []*buildapi.Build }
PrunerOptions contains the fields used to initialize a new Pruner.
type Resolver ¶
Resolver knows how to resolve the set of candidate objects to prune
func NewOrphanBuildResolver ¶
func NewOrphanBuildResolver(dataSet DataSet, BuildPhaseFilter []buildapi.BuildPhase) Resolver
NewOrphanBuildResolver returns a Resolver that matches Build objects with no associated BuildConfig and has a BuildPhase in filter