prune

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeploymentByDeploymentConfigIndexFunc

func DeploymentByDeploymentConfigIndexFunc(obj interface{}) (string, error)

DeploymentByDeploymentConfigIndexFunc indexes Deployment items by their associated DeploymentConfig, if none, index with key "orphan"

func FilterDeploymentsPredicate

func FilterDeploymentsPredicate(item *kapi.ReplicationController) bool

FilterDeploymentsPredicate is a function that returns true if the replication controller is associated with a DeploymentConfig

func FilterZeroReplicaSize

func FilterZeroReplicaSize(item *kapi.ReplicationController) bool

FilterZeroReplicaSize is a function that returns true if the replication controller size is 0

Types

type DataSet

type DataSet interface {
	GetDeploymentConfig(deployment *kapi.ReplicationController) (*deployapi.DeploymentConfig, bool, error)
	ListDeploymentConfigs() ([]*deployapi.DeploymentConfig, error)
	ListDeployments() ([]*kapi.ReplicationController, error)
	ListDeploymentsByDeploymentConfig(config *deployapi.DeploymentConfig) ([]*kapi.ReplicationController, error)
}

DataSet provides functions for working with deployment data

func NewDataSet

func NewDataSet(deploymentConfigs []*deployapi.DeploymentConfig, deployments []*kapi.ReplicationController) DataSet

NewDataSet returns a DataSet over the specified items

type Filter

type Filter interface {
	Filter(items []*kapi.ReplicationController) []*kapi.ReplicationController
}

Filter filters the set of objects

type FilterPredicate

type FilterPredicate func(item *kapi.ReplicationController) bool

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 PruneFunc

type PruneFunc func(item *kapi.ReplicationController) error

PruneFunc is a function that is invoked for each item during Prune

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(deploymentConfigs []*deployapi.DeploymentConfig, deployments []*kapi.ReplicationController, 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 deployments in candidate prune set keepComplete is per DeploymentConfig how many of the most recent deployments should be preserved keepFailed is per DeploymentConfig how many of the most recent failed deployments should be preserved

type Resolver

type Resolver interface {
	Resolve() ([]*kapi.ReplicationController, error)
}

Resolver knows how to resolve the set of candidate objects to prune

func NewOrphanDeploymentResolver

func NewOrphanDeploymentResolver(dataSet DataSet, deploymentStatusFilter []deployapi.DeploymentStatus) Resolver

NewOrphanDeploymentResolver returns a Resolver that matches objects with no associated DeploymentConfig and has a DeploymentStatus in filter

func NewPerDeploymentConfigResolver

func NewPerDeploymentConfigResolver(dataSet DataSet, keepComplete int, keepFailed int) Resolver

NewPerDeploymentConfigResolver returns a Resolver that selects items to prune per config

Jump to

Keyboard shortcuts

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