workload

package
v0.0.0-...-b7f36a4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const LabelSelector = "app.kubernetes.io/managed-by=churn"

Variables

View Source
var DefaultDeleteCandidates = []schema.GroupVersionResource{
	{Group: "projectcontour.io", Version: "v1", Resource: "httpproxies"},
	{Group: "extensions", Version: "v1beta1", Resource: "ingresses"},
	{Group: "", Version: "v1", Resource: "services"},
	{Group: "", Version: "v1", Resource: "pods"},
}

DefaultDeleteResources is the default list of resources to consider as deletion candidates.

Functions

func Run

func Run(stopChan <-chan struct{}, tasks []Task) error

Run runs a collection of Tasks until the stopChan becomes ready.

Types

type Policy

type Policy struct {
	// Resources is the resource types to operate on.
	Resources []schema.GroupVersionResource

	// Interval is the time to wait between operations.
	Interval time.Duration

	// Limit is the max number of operations per interval.
	Limit int
}

Policy configures a Task.

type PolicySpec

type PolicySpec struct {
	Operation     string
	ResourceNames []string
	Parameters    map[string]string
}

func ParsePolicySpec

func ParsePolicySpec(specString string) (PolicySpec, error)

ParsePolicySpec parses a policy specification string. A policy specification string is of the form:

OPERATION[:RESOURCE|PARAM=VALUE[,RESOURCE|PARAM=VALUE]...]

type Task

type Task interface {
	Perform() error
	Finalize() error
	Interval() time.Duration
}

Task is a single unit of a workload.

func NewDeleterForPolicy

func NewDeleterForPolicy(p Policy) (Task, error)

Jump to

Keyboard shortcuts

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